React Native update 0.60 brings new features and a breaking change.
Facebook has released version 0.60 for React Native framework for native iOS and Android apps.
So the wait has ended. Ryan Turner, Core Maintainer & React Native Developer, has announced an update of react native version 0.60. As expected, react native update comes with major improvements as most of you had already suspected when 0.59 release of React Native went in the first quarter of this year.
React Native version 0.60 comes with many improvements, but the top highlights are as follows:
1. AndroidX Support
2. CocoaPods integration by default
3. Full removal of WebView & Geolocation
4. Auto-linking of Packages
In react native version 0.60, the framework is updated to AndroidX. Support for AndroidX in RN is a breaking change. AndroidX is a significant factor in the Android ecosystem. To develop native applications for the Android platform, the cross-platform had been waiting for this update so long.
As the framework updated to AndroidX, developers will require to migrate the app’s native code and dependencies too. Though it will take time to migrate the native code, the community has provided a clever tool named “jetifier” that help to patch your node_modules. “Jetifier” is a temporary solution for developers to release an AndroidX version.
CocoaPods by Default
For 6.0, developers will be able to access CocoaPods in iOS by default. CocoaPods is an application-level dependencies manager that earlier was not available in npm packages in the framework.
To access the feature, developers are requested to open iOS platform code using the “xcworksplace” file from now on. Moreover, the Pod specifications for the internal packages have been updated to make them compatible with the Xcode projects. It will help with troubleshooting and debugging.
Lean Core Removals
ReactNative is a huge and complex project with a sophisticated repository. To bring this repository to a manageable state, WebView and NetInfo have been extracted into separate repositories. The team has already introduced Lean Core project in version 0.59 and believe in providing better management with separate libraries.
With React Native 0.60, Facebook and team have completely removed WebView and NetInfo from the React Native Repository. As policies of App Store has already changed, Geolocation has also been removed for the better keeping in view to the community feedback.
However, for an automated solution, one can consider using rn-upgrade-deprecated-modules.
Auto-linking of Packages
ReactNative is a cross-platform application development framework; thus libraries carry platform-specific or native code. React native update has introduced major improvements to native module linking called auto-linking.
An auto-linking mechanism will allow the project to find it and use the code easily. React Native CLI team has done a great job here. However, it is advised to react native developers who are thinking about switching to RN version 0.60 to unlink native dependencies from a previous install.
The team has worked and come up with surprising fixes for both for iOS and Android. These includes:
1. Various components have received missing roles
2. A new Accessibility States API is now provided that will ensure better web support in the future
3. AccessibilityInfo.announceForAccessibility is now supported on Android
4. Extended Accessibility Actions Support, means an added callbacks that deal with accessibility around user-defined actions
5. The iOS gets support for iOS accessibility flags and “reduce motion”
6. A clickable prop and an onClick callback are added for invoking actions via voice output and keyboard navigation.
Along with these exciting updates, the team and community have introduced a new tool named Upgrade Helper to make the upgrade process easier.
We already know React Native is a highly popular cross-platform application development framework. A new update of react native version 0.60 will be going to enhance the developer’s productivity and performance of react applications.
Though AndroidX support and CocoaPods by Default in iOS are the breaking stone in react native version 0.60, the wait for future updates will worth to take. Stay tuned for future updates.