New Architecture Known Issues & Troubleshooting #237
Pinned
cortinico
started this conversation in
Documentation
Replies: 1 comment
-
Can you please check this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
tl;dr: This post collects all the known issues with related resolutions to help users migrate the the New Architecture
Hi all,
With React Native 0.76 approaching, we want to collect in a single place all the known issues and troubleshooting we collected from the previous months of experimentation with the New Architecture.
This is a living document and we’ll be updating this document as we get more bug reports. If you encounter any issues migrating to the New Architecture, please open a new issue using this template.
Modules Known Issues
Unable to use
Object.keys
on NativeModulesAnswer: This is by design. We designed the TurboModule system with the goal of lazy loading, so we don’t have to load all the modules in memory when the app is launched. This should let your app start faster.
One of the trade-offs of this solution is that you cannot call
Object.keys
on a native module right away, because not all the keys might be available immediately.Instead, you can read them by leveraging the inheritance. You can call
Object.keys
on the native module prototype and the result should be the same as before.** [iOS] Cannot access
CallInvoker
fromRCTCxxBridge.callInvoker
Answer: In bridgeless mode, the bridge is not initialized anymore. So, if you were retrieving the
jsCallInvoker
instance from the[RCTBridge currentBridge]
invocation, that might not work well anymore.If you need this functionality, the best approach is to implement a pure C++ TurboModule which receives the callInvoker as a parameter when it is initialized.
This will also help you write more encapsulated code.
Components Known Issues
** Components with custom Shadow Nodes and measurement are not working with the Interop Layer.
Answer: This is by design because the New Architecture stores the shadow node and layout information in the C++ layer. If your custom component/library is providing a custom shadow node implementation you won’t be able to use it via the Interop Layer (this is a known limitation of the Interop Layer).
Specifically on Android, if your
ViewManager
class is implementing any of those methods:createShadowNodeInstance()
(reference)createShadowNodeInstance(ReactApplication)
(reference)createShadowNodeClass()
(reference)measure(Context,ReadableMap,ReadableMap,ReadableMap,float,YogaMeasureMode, float, YogaMeasureMode heightMode, float[])
(reference)Your component won’t be working with the Interop Layer and will require an implementation with the new Renderer.
Beta Was this translation helpful? Give feedback.
All reactions