react-test-renderer `update` method does not rerender component with new props
See original GitHub issuereact-hooks-testing-library
version: 4.0.0react-test-renderer
version: 17.0.1react
version: 17.0.1node
version: 14.0.0npm
(oryarn
) version: 1.22.5 (yarn)
Reproduction:
https://github.com/joshuaellis/react-test-renderer-update-issue
Problem description:
@testing-library/react-hooks
rerender function uses react-test-renderer
update
under the hood. The props are correctly passed to update
function but the hook does not re-render with the new props so the test fails.

Suggested solution:
I think this has something to do with react-test-renderer
so i’ve raised it with them here but also want to keep an eye on it.
The expected behavior
the last two logs (in the image above) should say: “using func func2” “im func 2”
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Bug: react-test-renderer `update` method does not rerender ...
The props are correctly passed to update function but the hook does not re-render with the new props so the test fails.
Read more >React doesn't rerender on state change while testing
First add a test-id to your checkbox component like this : <input type="checkbox" checked={checkboxState} data-testid="checkboxID" />.
Read more >Test Renderer - React
Re-render the in-memory tree with a new root element. This simulates a React update at the root. If the new element has the...
Read more >Update Props of Render Component in React Testing Library
This proves that the rendered component does not remount when using the rerender function (i.e. a new instance of the rendered component is...
Read more >Top 5 react-test-renderer Code Examples - Snyk
Learn more about how to use react-test-renderer, ... toEqual(['0']); }); // This update should not trigger a re-render renderer.act(() ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try making it
I’ll take a look, i’ve been trying to make my way through the issues we’ve got open and understand them properly 👍🏼