Skip to content

Bug: react-test-renderer update method does not rerender component with new props #20561

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

Closed
joshuaellis opened this issue Jan 8, 2021 · 1 comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@joshuaellis
Copy link

React version: 17.0.1

Steps To Reproduce

  1. clone this repo
  2. install node_modules
  3. run yarn test

Link to code example: https://github.com/joshuaellis/react-test-renderer-update-issue

The current behavior

@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.

image

The expected behavior

the last two logs (in the image above) should say:
"using func func2"
"im func 2"

@rickhanlonii
Copy link
Member

Hey @joshuaellis, if you can't reproduce this without testing-library, I recommend tracking this in the issue you created there in testing-library/react-hooks-testing-library#530. If this ends up being a bug in React let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

2 participants