-
Notifications
You must be signed in to change notification settings - Fork 45.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
Remove indirection in checking propTypes #9358
Conversation
Hmm this seems like the wrong way to do it because of a circular dep. Easier to kill this module and do it differently I think. |
7ef7f6b
to
3e508c2
Compare
OK should be ready for review! |
3e508c2
to
c373c97
Compare
We can remove |
Means we technically start to depend on it? |
Yeah we can remove |
Although, because of flat bundles it would just be a dev dependency, right? |
Currently cjs flat bundles still use |
I'll get this in for now so I can continue work on RN flat bundling, happy to change later. |
TLDR: I’m removing
react/lib/checkPropTypes
import in favor ofReact.checkPropTypes
public API access from renderer, and directcheckPropTypes
access from the core.Shared
checkReactTypeSpec
currently depends onreact/lib/checkPropTypes
which is gone in flat bundles. So this breaks in React Native sync process. In DOM, we currently ship two copies (in both React and ReactDOM flat bundles) but this breaks until RN is also a flat bundle. I could shim it but this seems like an easy fix because there’s a public API for this now.The fix inside React package is just to import the internal
checkPropTypes
module directly.The fix inside renderers is to use the public API (
React.checkPropTypes
).