-
Notifications
You must be signed in to change notification settings - Fork 723
Update docs with reactStrictMode
in render
#1479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,7 @@ as these methods: | |||||
- [`onRecoverableError`](#onrecoverableerror) | ||||||
- [`wrapper`](#wrapper) | ||||||
- [`queries`](#queries) | ||||||
- [`reactStrictMode`](#render-options-reactstrictmode) | ||||||
- [`render` Result](#render-result) | ||||||
- [`...queries`](#queries-1) | ||||||
- [`container`](#container-1) | ||||||
|
@@ -31,7 +32,8 @@ as these methods: | |||||
- [`initialProps`](#initialprops) | ||||||
- [`onCaughtError`](#oncaughterror) | ||||||
- [`onRecoverableError`](#onrecoverableerror) | ||||||
- [`wrapper`](#wrapper-1) | ||||||
- [`wrapper`](#renderhook-options-wrapper) | ||||||
- [`reactStrictMode`](#renderhook-options-reactstrictmode) | ||||||
- [`renderHook` Result](#renderhook-result) | ||||||
- [`result`](#result) | ||||||
- [`rerender`](#rerender-1) | ||||||
|
@@ -161,6 +163,11 @@ utility functions to create custom queries. | |||||
Custom queries can also be added globally by following the | ||||||
[custom render guide](setup.mdx#custom-render). | ||||||
|
||||||
### `render` Options `reactStrictMode` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Isn't this redundant? Also don't forget to update the anchor if you accept the change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming it only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's nested below "render Options" already so there shouldn't be a conflict. Or do you mean the anchors conflict? Can we decouple the anchor ID from the heading name? This just seems noisy at the moment:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Exactly.
It seems auto-generated. How would you suggest we do that?
Yeah, I agree, but I was following the same pattern as Happy to change, but I'm not sure if there's an easy solution. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then let's keep it for now. Could even argue the repeated context is good on nested list with lots of siblings since it reduces cognitive overhead. |
||||||
|
||||||
When enabled, [`<StrictMode>`](https://react.dev/reference/react/StrictMode) is rendered around the inner element. | ||||||
If defined, overrides the value of `reactStrictMode` set in [`configure`](https://testing-library.com/docs/react-testing-library/api/#configure-options). | ||||||
|
||||||
## `render` Result | ||||||
|
||||||
The `render` method returns an object that has a few properties: | ||||||
|
@@ -431,6 +438,11 @@ Behaves the same as [`onRecoverableError` in `ReactDOMClient.createRoot`](https: | |||||
|
||||||
See [`wrapper` option for `render`](#wrapper) | ||||||
|
||||||
|
||||||
### `renderHook` Options `reactStrictMode` | ||||||
|
||||||
See [`reactStrictMode` option for `render`](#render-options-reactstrictmode) | ||||||
|
||||||
## `renderHook` Result | ||||||
|
||||||
The `renderHook` method returns an object that has a few properties: | ||||||
|
@@ -503,3 +515,5 @@ configure({reactStrictMode: true}) | |||||
|
||||||
When enabled, [`<StrictMode>`](https://react.dev/reference/react/StrictMode) is | ||||||
rendered around the inner element. Defaults to `false`. | ||||||
|
||||||
This setting can be changed for a single test by providing `reactStrictMode` in the options argument of the [`render`](#render-options-reactstrictmode) function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link was wrong