Closed
Description
react-testing-library
version:5.4.4react
version:16.7.0node
version: v8.10.0npm
(oryarn
) version: yarn 10.1.1
Relevant code or config:
in a previously closed ticket #65 (comment) you suggest calling
render(<C {...newProps}/>, container)
to rerender with new props, but when I do this, the existing instance is not updated, but I get a new instance of the component.
What you did:
- set a breakpoint in my component's constructor, render, and componentDidUpdate functions
- call {{const {container} = render()}}
- The constructor and render breakpoints are hit. In render, I set
window.xxx=this
- call
render(<C value="177"/>, container)
- I see the constructor and render called. componentDidUpdate is not called and
window.xxx!==this
What happened:
Reproduction:
https://codesandbox.io/s/jj56q52rqw
You can see that the test output renders 2 instances of the Hello component, and that componentDidUpdate is never called
Problem description:
I don't know how to test property change behavior on my components
Suggested solution:
Metadata
Metadata
Assignees
Labels
No labels