Search code examples
react-nativereact-native-ioscode-pushreact-native-code-push

Should I generate a native build when i add native libraries in react native 0.61+?


I have been using RN 0.61.+ for my android and ios app with Codepush for remote JS updates.

With react native auto-linking enabled in 0.60+. When we add a native library, there is no native code added in the android and ios folders except that we need to do a pod install for iOS.

Does this mean I can simply do update to users with JS Bundle on codepush? Or do I have to still create native builds and release on stores?


Solution

  • Yes you have to create new builds. Here is why When you add a new native library that supports auto linking you may not see any change in the Android folder but the magic happens in build time where the cli would go through the dependencies and link everything for you. In the case of ios as you said you install them using pod install.

    I can simply do update to users with JS Bundle on codepush

    You can do this but there is a high chance your app would crash during run time. Let say you update a library to a newer version and you update your JS Bundle, when your JS code access a newly added method in native code there will be a problem. If both signatures match it might work but its an unwanted risk.

    So if you are adding a native library always go for a new build.