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
[react-test-renderer] Fix findByType
broken for SimpleMemoComponent
#17700
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 00c4d15:
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
151c2c2
to
00c4d15
Compare
This seems like it would break code searching by the inner type, right? I think we need a more fleshed out proposal for how you imagine this working ideally. You probably don't want different behavior for |
@gaearon what would be a better solution then? Would it make sense to change the Flow types of React so that you can write |
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you! |
Fix #17301 .
The fix is simply check if the
tag
of the fiber node isSimpleMemoComponent
, and check theelementType
instead oftype
.I'm not fully understand the difference between
elementType
andtype
in test-renderer though, looks like if we changed to always get theelementType
instead oftype
would also work? Maybe it has something to do withLazy
andSuspense
, but AFAIKreact-test-renderer
currently doesn't support them.