-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Fix] shallow
: ensure SCU is called after GDSFP returns null
#1981
Conversation
Thanks! Can we add the same test case for |
070a708
to
926b306
Compare
@ljharb react 16.8 is out. I have tried manually upgrade |
@chenesan i'm not sure what you mean; it should be auto installed |
926b306
to
8e7c84a
Compare
The error showing up in the tests is specific to React 16.3. It seems like this might be fixable in the 16.3 adapter? |
@ljharb I think it's not fixable in 16.3 because it's fixed in react-test-renderer@16.8. I'll add an additional
At that time I noticed the |
@ljharb I saw that the build failed in React=16.0 and node=4 after my push. I looked into the log and it failed in |
@chenesan i'd prefer if we could add whatever changes are necessary to fix it in 16.3, with react-test-renderer 16.3. We've done similar fixes before. As for the correct version of react-test-renderer, that's something I might have to fix - testing should be done with react-test-renderer at the same minor version as react itself. |
@ljharb Ok, I'll try to fix this in adapter 16.3. However, since the lifecycle logic is running in the react shallow renderer, I think it would be hard or not possible to fix this (maybe I'm wrong).
Could you guide me where the related issues / fixes are? Maybe I can get some ideas from this. Thanks :-) |
Mainly, we can spy on component methods, so that we should be able to determine when individual lifecycle methods occur. |
552714e
to
9e2b05e
Compare
@ljharb I think this could be reviewed now :). I tried to wrap sCU and set instance state as correct old state so |
9e2b05e
to
faea638
Compare
I've updated/rebased this; but it seems like facebook/react@4f33288 doesn't actually fix the bug in react-test-renderer 16.8+ - once I made it so that the fix only applied to 16.3 - 16.7, the 16.8 tests failed locally :-/ altho everything seems to pass in CI, so I'm a bit confused. |
faea638
to
b66ac28
Compare
Hmm interesting :( I'd try to take a look in this week. |
b66ac28
to
504e4fc
Compare
shallow
: ensure SCU is called after GDSFP returns null
k, figured it out. The bug is dependent on |
504e4fc
to
98154a9
Compare
- [fix] add `hasShouldComponentUpdateBug` to gDSFP lifecycles option (#1981)) - [refactor] use `displayNameOfNode` instead of `function.prototype.name` directly - [meta] add "directory" field to package.json - [deps] update `react-is`, `enzyme-adapter-utils`, `prop-types`
Prevent forgetting PR for #1970 😓 . I've added test case in this PR(should fail now).
Wait for release of facebook/react#14613 and we can update react-test-renderer in dependency.
Fixes #1970.