feat(pure): add renderOptions support to render
What:
Why:
How:
Checklist:
- [ ] Documentation added to the docs site
- [x] Tests
- [x] TypeScript definitions updated
- [ ] Ready to be merged
closes 1297
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit faba7c10171b1966c145d39a6208c55721d8349d:
| Sandbox | Source |
|---|---|
| react-testing-library-examples | Configuration |
We should flatten this instead of allowing arbitrary options. We don't know if a passing all through will make sense. If people want to access the root options directly, they can always switch to createRoot directly.
We should flatten this instead of allowing arbitrary options. We don't know if a passing all through will make sense. If people want to access the root options directly, they can always switch to
createRootdirectly.
how should we handle the cases where the consumer uses the non-canary version that currently does not expose those options?
how should we handle the cases where the consumer uses the non-canary version that currently does not expose those options?
Is there something different in that regard between your initial version and the version I proposed?
how should we handle the cases where the consumer uses the non-canary version that currently does not expose those options?
Is there something different in that regard between your initial version and the version I proposed?
First of all, sorry for the delayed response.
Afaik it's different in the sense that we base the type definitions on what the version the consumer uses, in React 18 they won't get type autocompletions for v19 canary definitions, and vice verse.
Afaik it's different in the sense that we base the type definitions on what the version the consumer uses, in React 18 they won't get type autocompletions for v19 canary definitions, and vice verse.
That's intended though, no? I don't see how type concerns need to dictate our API. It seems to me we can make flat options work. It just requires a bit more type-implementation work on our part.
Alternate: https://github.com/testing-library/react-testing-library/pull/1354
Alternate: https://github.com/testing-library/react-testing-library/pull/1354
Sorry I ended up not finishing this task, had some IRL things to deal with.
Thanks for taking this task, I should've communicated earlier.