React Installation
Get started with Firebridge on React.
Install The Package
All of the Firebridge packages are available on npm. You can install them with your package manager of choice.
Wrap Your Application
You’ll need to wrap your project in a FirebridgeProvider
. This allows us to track the auth state and provide it to the rest of the app.
Since Firebase for the web uses a modular SDK, you’ll need to provide the auth instance to the provider. Generally, this will be done in a separate file, but we’ve included it here for completeness. On native, the auth instance is not needed since one is provided by react-native-firebase
. Simply wrapping the app in the provider is enough.
Use the Hooks
Now that your app is wrapped in the provider, you can use the hooks to access the auth state. You now have everything you need to build a clean developer experience for real time connections to collections and documents in Firestore.
You can now see what the hooks look like in action. Everything is secure, it’s all typed, and the developer experience is clean and descriptive. Once you’re used to thinking in terms of real time data and hooks, you’ll never want to go back.