I am trying to use to use Firebase (Cloud Firestore) for a react-native app, to store my JSON objects.
I ve seen people using Firebase in their apps (npm install firebase), and others using react-native-firebase.
Most blogs say that Firebase itself is meant for web, so their react-native support is none/less. While a few other blogs and firebase official blog say that Firebase supports react-native.
I am not sure which library to choose, for my react-native project, and what's the difference between them.
Firebase belongs to "Realtime Backend / API" category of the tech stack, while React Native Firebase can be primarily classified under "Platform as a Service Tools". Some of the features offered by Firebase are: Add the Firebase library to your app and get access to a shared data structure.
Firebase SDKs provide authentication methods for developers, so they don't have to reimplement common login systems such as Google or Facebook login. This includes UI elements in the Web, Android, and iOS SDK versions for Firebase, however, these UI components do not work with React Native and should not be called.
Firebase is a Backend as a Service (BaaS) that provides an advantage to mobile developers who use React Native for developing mobile applications. As a React Native developer, by using Firebase you can start building an MVP (minimum viable product), keeping the costs low and prototyping the application pretty fast.
React Native Firebase is a collection of official React Native modules connecting you to Firebase services; each module is a light-weight JavaScript layer connecting you to the native Firebase SDKs for both iOS and Android.
According to project description on GitHub:
React Native Firebase is a light-weight javascript layer connecting you to the native Firebase SDKs for both iOS and Android which aimes to mirror the offical Firebase Web SDK as closely as possible.
Although the official Firebase JS SDK will work with React Native; it is mainly built for the web and has a limited feature-set compared to native.
So, you should choose it, for react native platform. This will allow you to use more features and also benefit from using native sdk's (speed, memory consumption, etc.)
Add up from Dima Rostopira's Answer.
You need to use JS SDK in react native when you use expo. Because expo not let you add custom native modules. Else go with react native SDK
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With