-
Notifications
You must be signed in to change notification settings - Fork 47.6k
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
[Native] Delete NativeComponent and NativeMethodsMixin #18036
[Native] Delete NativeComponent and NativeMethodsMixin #18036
Conversation
Details of bundled changes.Comparing: d4f2b03...69a7f78 react-native-renderer
Size changes (experimental) |
Details of bundled changes.Comparing: d4f2b03...69a7f78 react-native-renderer
Size changes (stable) |
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 69a7f78:
|
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.
Yaaaaaaas 🔥🔥🔥
* [Native] Delete NativeComponent and NativeMethodsMixin * Remove more files
|
||
/** | ||
* Flat ReactNative renderer bundles are too big for Flow to parse efficiently. | ||
* Provide minimal Flow typing for the high-level RN API and call it a day. | ||
*/ | ||
export type ReactNativeType = { | ||
NativeComponent: typeof ReactNativeComponent, |
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.
I think this was a breaking change because now people cannot importNativeComponent
.
The fix is to migrate to the exported HostComponent
type.
Summary
NativeComponent and NativeMethodsMixins were JS APIs for creating components that proxied the methods to the underlying host component by using
findNodeHandle
. Nothing in core uses these anymore, core uses forwardRef instead. We can finally delete these!These APIs weren't exposed as part of the public API of React Native so this isn't a breaking change.
Test Plan
Jest, Flow. I also imported this diff into Facebook to run a build size bot and mobile lab. Diff here: https://our.internmc.facebook.com/intern/diff/D19458361/