dillon1000/react

Commit

Defer reading native view config from UIManager until view is used (#10569)

* ReactNative supports lazy view registration
Don't react viewConfig from UIManager when a view is registered, but only when it is used for the first time. This will help unblock Prepack optimizations for RN views.

* Added new lazy-creation method for native views
Also exposed the native view config registry to allow invalid/unsupported host components to fall back to RCTView

* Removed ReactNativeViewConfigRegistry from RN __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
After discussion with Spencer Ahrens and Andy Street, it seems the early fallback behavior was mostly for the early days of Ads Manager when Android didn't yet support a lot of the view types. It should be okay now to use an invarient/redbox instead for unsupported views.

* Removed non-lazy createReactNativeComponentClass impl
There are only a handful of components with JavaScript-defined view configs. It's probably worth making them use the new lazy/async interface as well to be more consistent.
Browse files
Changed paths11 files
First-parent comparison
M src/renderers/native/NativeMethodsMixin.js ModifiedM src/renderers/native/ReactNativeComponent.js ModifiedM src/renderers/native/ReactNativeFiberEntry.js ModifiedM src/renderers/native/ReactNativeFiberHostComponent.js ModifiedM src/renderers/native/ReactNativeFiberRenderer.js ModifiedM src/renderers/native/ReactNativeTypes.js ModifiedM src/renderers/native/ReactNativeViewConfigRegistry.js ModifiedM src/renderers/native/__tests__/ReactNativeEvents-test.js ModifiedM src/renderers/native/__tests__/ReactNativeMount-test.js ModifiedM src/renderers/native/__tests__/createReactNativeComponentClass-test.js ModifiedM src/renderers/native/createReactNativeComponentClass.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…