Skip to content

Platform APIs

Platform APIs usage

We asked members of the React Native community to share their opinions about the results

The ability to access native platform APIs in your app is one of the key reasons to choose React Native as an application technology. It can enable some truly useful experiences for users when the full power of their mobile device hardware is under your application's control. However, the technical challenge of creating and maintaining a native API wrapper for React Native is daunting! As mentioned in the "React Native pain points" section, "Unmaintained packages" is a consistent pain point year on year. One reason for this is that creating and maintaining a native API package implies understanding Objective-C/Swift and Java/Kotlin as well as the New Architecture and Old Architecture. Add in a sprinkling of javascript, community management, and NPM package publishing thrown in to keep it spicy, and it is a lot! It is no surprise many maintainers burn out and orphan the native packages. As a maintainer of many native API packages it seems there is always a library user with an issue, and never enough PRs to help - a typical open source conundrum.

One of the interesting things I see in the native API package space over the years is the friendly competition between community native API packages and the packages in the Expo ecosystem. Expo has wrappers for nearly all the native APIs, at the same time there is a parallel community package that wraps the same APIs, frequently with very similar download counts. At first glance this may seem to be a wasteful duplication of resources but in practice as both packages are open source it is easy to reuse good ideas, and in 2022/2023 Expo with their config plugins has made it easier for their users to use community packages. The rise of config plugins has contributed significantly to adoption of react-native-firebase (a package I maintain) for instance and has really helped application developers get things done for some specific needs only handled in community packages, while the typical use cases for Expo apps are handled nicely with the Expo packages. Where will the future take us for native APIs? I believe 2024 will be the year most modules will complete the conversion to the New Architecture but one thing will remain true from previous years: the progress of the native module APIs will depend on PRs and support from the community. So be kind to your maintainers and post PRs when you can.

We asked members of the React Native community to share their opinions about the results

Mike Hardy

Maintainer of react-native-firebase among many other native API packages, on behalf of Invertase