You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/upgrade-guide.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
As announced in [Discussion 402](https://github.com/FirebaseExtended/reactfire/discussions/402), ReactFire v4 contains breaking changes. This guide details how to upgrade from v3 to v4.
4
4
5
-
1. Get the latest version of ReactFire and Firebase
5
+
**1. Get the latest version of ReactFire and Firebase**
6
6
7
7
```
8
8
npm i firebase@latest reactfire@latest
@@ -12,14 +12,21 @@ npm i firebase@latest reactfire@latest
12
12
yarn add firebase@latest reactfire@latest
13
13
```
14
14
15
-
2. Initialize product SDKs and register them with ReactFire
15
+
**2. Initialize product SDKs and register them with ReactFire**
16
16
17
17
You'll need to explicitly initialize each Firebase product you use and pass the initialized SDK into a provider component. For example, if you use the `useUser` hook in a component, make sure a parent sets up Firebase Auth with the `AuthProvider` component. Here's a [code sample](./use.md#initialize-product-sdks-and-register-them-with-reactfire).
18
18
19
19
If you need to connect to the Local Emulator Suite, [check out this code sample](./use.md#connect-to-the-firebase-local-emulator-suite).
20
20
21
21
For times when you need to asynchronously initialize a product, like [accessing Firestore data offline](./use.md#access-data-offline) or [activating Remote Config](./use.md#initialize-fetch-and-activate), you can use hooks like `useInitFirestore` and `useInitRemoteConfig`. These hooks replace the preload functions.
22
22
23
-
3. Update your Firebase code
23
+
**3. Update your Firebase code**
24
24
25
25
You'll need to [refactor to the modular style](https://firebase.google.com/docs/web/modular-upgrade#refactor_to_the_modular_style) of the new Firebase SDK. You can find per-product examples of using ReactFire with the new Firebase SDK [here](./use.md#using-reactfire).
26
+
27
+
> Need some samples? Check out the diffs between v3 and v4 for code in the `examples` directory of the ReactFire repo:
0 commit comments