-
Notifications
You must be signed in to change notification settings - Fork 49.8k
Shallow renderer: support multiple setState invocation
#11167
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
Conversation
|
cc @bvaughn who I believe originally wrote it. Looks good to you? |
bvaughn
left a comment
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.
It's been a while since I've thought about this component too closely 😁 but this change looks good to me. I appreciate the newly-added tests.
|
@Hypnosphi Could you please also get a local clone of Enzyme running and verify that patching this up in |
|
I did: # in react directory
yarn build
cd build/packages/react-test-renderer
yarn link
cd ../../../.. # parent of react directory
git clone https://github.com/airbnb/enzyme.git
cd enzyme
yarn
yarn react:16
yarn link react-test-renderer
yarn test:onlyAnd it passes |
|
Sweet. Thanks. |
Issue: #11161
This PR ensures that subsequent calls to
setState:setStateas base state when shallow merging