Files
react-native/Libraries/ReactNative
David Vacca f96478778c Ensure iOS Native components are initialized when using JS View configs
Summary:
As part of the initialization of Native View configs, the PaperUIManager.getViewManagerConfig() method calls the native side to lazy initialize iOS Native components. This is necessaary to make ensure that native classes are loaded and initialized before a view is created.
Note that this requirement is only necessary when Fabric is disabled.

As part of JS ViewConfigs, we removed the native call to lazy initialize iOS native components. This causes a crash during the creation of NativeViews when JS ViewConfigs are enabled and Fabric is disabled. The rootcase of the exception is that native classes are not properly initialized when the createView method is executed in iOS.

This diff forces the lazy initialization of iOS Native components when JS View configs are enabled and Fabric is disabled. This new mechanism is executed as part of the creation of views and it's ONLY going to be executed when the user navigates to a NON-FABRIC screen, JS ViewConfigs are enabled and the component is not initialized yet.

The extra cost should be minimal or zero.

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D25387014

fbshipit-source-id: fe3bc42f803a805192b419bfb4b7a6b5b1b71b60
2020-12-07 23:14:02 -08:00
..
2019-10-16 10:06:34 -07:00
2019-10-16 10:06:34 -07:00