-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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 for pretty-format and react elements #7460
Conversation
This is also very dependent on RN version – |
Can we use https://www.npmjs.com/package/react-is? |
Ergh, the fix this PR attempt to provide isn't solved... Not sure why I closed this. We now use |
@rickhanlonii any plans for this? |
Probably will not be able to look at this until next year |
@rickhanlonii it's a new year! 😀 |
Wow, @SimenB I literally just started fixing this because it's a bigger issue on the React main branch, thanks for bumping and reminding me that I already fixed it. I'll get this in. |
Perfect! 😀 We got #10120 from a Ghost as well, should it be closed by this? |
Actually I'm going to close this, the bug here was in the way we were doing mocks in React Native and was fixed by facebook/react-native@4b935ae |
👍 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This PR fixes an issue with the pretty-format react plugin where it was only checking the
$$typeof
symbol for object element types. I found that function element types are possible with the$$typeof
checks, so I moved those checks to before thetypeof type === function
checkThe practical change is that in some scenarios, instead of printing
We will now print
Test plan
I actually can't figure out how to write a test for this issue in our repo, but I did apply the change manually in https://github.com/rajivshah3/rn-broken-snapshot/tree/broken-example, where I discovered the issue, to confirm the fix
I suspect it's related to some combination of jest, react, react-native, and react-test-renderer