diff --git a/.all-contributorsrc b/.all-contributorsrc
deleted file mode 100644
index b89f2cf2..00000000
--- a/.all-contributorsrc
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "projectName": "reactfire",
- "projectOwner": "FirebaseExtended",
- "repoType": "github",
- "repoHost": "https://github.com",
- "files": [
- "README.md"
- ],
- "imageSize": 100,
- "commit": true,
- "commitConvention": "none",
- "contributors": [
- {
- "login": "prescottprue",
- "name": "Scott Prue",
- "avatar_url": "https://avatars0.githubusercontent.com/u/2992224?v=4",
- "profile": "http://prue.io",
- "contributions": [
- "code"
- ]
- },
- {
- "login": "w3bdesign",
- "name": "w3bdesign",
- "avatar_url": "https://avatars1.githubusercontent.com/u/45217974?v=4",
- "profile": "http://www.dfweb.no",
- "contributions": [
- "code"
- ]
- },
- {
- "login": "jhuleatt",
- "name": "Jeff",
- "avatar_url": "https://avatars0.githubusercontent.com/u/3759507?v=4",
- "profile": "http://git.io/jhuleatt",
- "contributions": [
- "code"
- ]
- }
- ],
- "contributorsPerLine": 7,
- "skipCi": true
-}
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index b541f5d5..1cde9530 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -100,6 +100,8 @@ jobs:
key: firebase_emulators
- name: 'Download Artifacts'
uses: actions/download-artifact@v2
+ - name: Check available files/dirs
+ run: ls -a
- name: Expand Artifact
run: |
chmod +x reactfire-${{ github.run_id }}/unpack.sh
@@ -109,8 +111,8 @@ jobs:
publish:
runs-on: ubuntu-latest
name: Publish (NPM)
- needs: test
- if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
+ needs: build
+ if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/modular-firebase' || github.event_name == 'release' }}
steps:
- name: Setup node
uses: actions/setup-node@v2-beta
diff --git a/.gitignore b/.gitignore
index d184edce..17db160c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,4 @@ publish.sh
unpack.sh
example/.parcel-cache/
+.firebaserc
diff --git a/README.md b/README.md
index 385765e3..983184c9 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
# ReactFire
-
+Hooks, Context Providers, and Components that make it easy to interact with
+Firebase.
-[](#contributors-)
+---
-
+> **WARNING**: This branch is the work in progress for version 4 of ReactFire. [You can find version 3 here](https://github.com/firebaseextended/reactfire/tree/v3), if you're looking for documentation or to contribute to stable.
-Hooks, Context Providers, and Components that make it easy to interact with
-Firebase.
+---
## What is ReactFire?
@@ -15,27 +15,18 @@ Firebase.
like `useUser`and `useFirestoreCollection` let you easily subscribe to
auth state, realtime data, and all other Firebase SDK events. Plus, they automatically unsubscribe when your component unmounts.
- **Access Firebase libraries from any component** - Need the Firestore SDK? `useFirestore`. Remote Config? `useRemoteConfig`.
-- **Built-in Support for prefetching** - Decrease your load times by starting a connection to products like Firestore, Auth, or Realtime Database before the component that consumes that data is rendered with functions like `preloadUser`
-- **Safely configure Firebase libraries** - Libraries like Firestore and Remote Config require setting like `enablePersistence` to be set before any data fetches are made. This can be tough to support in React's world of re-renders. ReactFire gives you a trusted way to set these settings so you're sure they're set before anything else.
-
-### Experimental [concurrent mode](https://reactjs.org/docs/concurrent-mode-suspense.html) features
-
-- **Loading states handled by ``** - ReactFire's hooks throw promises
- that Suspense can catch. No more `isLoaded ?...` - let React
- [handle it for you](https://reactjs.org/docs/concurrent-mode-suspense.html).
-- **Faster initial page load times** - Load only the code you need, when you need it, with `useFirestore`, `useAuth`, `useRemoteConfig`, and more.
-- **Convenient components for common use cases** - Only want to render a component if a user is signed in? Wrap it in ``. Need to automatically instrument your `Suspense` load times with [RUM](https://firebase.google.com/docs/perf-mon)? Use ``.
+- **Safely configure Firebase libraries** - Libraries like Firestore and Remote Config require settings like `enablePersistence` to be set before any data fetches are made. This can be tough to support in React's world of re-renders. ReactFire gives you `useInitFirestore` and `useInitRemoteConfig` hooks that guarantee they're set before anything else.
## Install
```bash
# npm
-npm install --save reactfire firebase
+npm install --save reactfire@exp firebase@exp
# or
# yarn
-yarn add reactfire firebase
+yarn add reactfire@exp firebase@exp
```
Depending on your targeted platforms you may need to install polyfills. The most commonly needed will be [globalThis](https://caniuse.com/#search=globalThis) and [Proxy](https://caniuse.com/#search=Proxy).
@@ -46,33 +37,32 @@ Depending on your targeted platforms you may need to install polyfills. The most
- Advanced: If you're using Concurrent Mode, check out the [Concurrent Mode quickstart](./docs/quickstart-concurrent-mode.md)
- [**Common Use Cases**](./docs/use.md)
- [**API Reference**](./docs/reference)
+- [**v3 -> v4 Upgrade Guide**](./docs/upgrade-guide.md)
## Example use
Check out the
-[live version on StackBlitz](https://stackblitz.com/fork/reactfire-sample)!
+[live version on StackBlitz](https://stackblitz.com/fork/reactfire-v4-sample)!
```jsx
-import React, { Component } from 'react';
+import React from 'react';
import { render } from 'react-dom';
-import 'firebase/firestore';
-import { FirebaseAppProvider, useFirestoreDocData, useFirestore } from 'reactfire';
+import { doc, getFirestore } from 'firebase/firestore';
+import { FirebaseAppProvider, FirestoreProvider, useFirestoreDocData, useFirestore, useFirebaseApp } from 'reactfire';
const firebaseConfig = {
- /* Add your config from the Firebase Console */
+ /* Add in your config object from the Firebase console */
};
-function Burrito() {
- // easily access the Firestore library
- const burritoRef = useFirestore()
- .collection('tryreactfire')
- .doc('burrito');
+function BurritoTaste() {
+ // access the Firestore library
+ const burritoRef = doc(useFirestore(), 'tryreactfire', 'burrito');
// subscribe to a document for realtime updates. just one line!
const { status, data } = useFirestoreDocData(burritoRef);
- // easily check the loading status
+ // check the loading status
if (status === 'loading') {
return
-
-
+
+
);
}
-render(, document.getElementById('root'));
+render(
+
+
+ ,
+ document.getElementById('root')
+);
```
---
@@ -104,24 +100,9 @@ render(, document.getElementById('root'));
This repository is maintained by Googlers but is not a supported Firebase product. Issues here are answered by maintainers and other community members on GitHub on a best-effort basis.
-## Contributors ✨
-
-Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
-
-
-
-
-
-
-
-
+### Extra Experimental [concurrent mode](https://reactjs.org/docs/concurrent-mode-suspense.html) features
-
-
-This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
+- **Loading states handled by ``** - ReactFire's hooks throw promises
+ that Suspense can catch. No more `isLoaded ?...` - let React
+ [handle it for you](https://reactjs.org/docs/concurrent-mode-suspense.html).
+- **Automatically instrument your `Suspense` load times** - Need to automatically instrument your `Suspense` load times with [RUM](https://firebase.google.com/docs/perf-mon)? Use ``.
diff --git a/build.sh b/build.sh
index 8e3b4147..fd86d34a 100755
--- a/build.sh
+++ b/build.sh
@@ -11,8 +11,8 @@ if [[ $GITHUB_REF =~ $TAG_TEST ]]; then
NPM_TAG=latest
fi;
else
- OVERRIDE_VERSION=$(node -e "console.log(require('./package.json').version)")-canary.$SHORT_SHA
- NPM_TAG=canary
+ OVERRIDE_VERSION=$(node -e "console.log(require('./package.json').version)")-exp.$SHORT_SHA
+ NPM_TAG=exp
fi;
npm --no-git-tag-version --allow-same-version -f version $OVERRIDE_VERSION
diff --git a/database.rules.json b/database.rules.json
new file mode 100644
index 00000000..40627650
--- /dev/null
+++ b/database.rules.json
@@ -0,0 +1,9 @@
+{
+ "rules": {
+ ".read": "true",
+ ".write": "true",
+ "items": {
+ ".indexOn": "a"
+ }
+ }
+}
\ No newline at end of file
diff --git a/docs/quickstart-concurrent-mode.md b/docs/quickstart-concurrent-mode.md
deleted file mode 100644
index 70f8ede7..00000000
--- a/docs/quickstart-concurrent-mode.md
+++ /dev/null
@@ -1,208 +0,0 @@
-# Getting Started with ReactFire + React [concurrent rendering](https://reactjs.org/docs/concurrent-mode-intro.html)
-
-> ⚠️ This quickstart relies on ReactFire's concurrent rendering features. We'd love PRs that add samples that work with stable builds of React!
-
-⚛ + 🔥 = 🌯
-
-This quickstart shows you how to connect your React web app to **Cloud Firestore**, listen for its data, and display the data in _real time_. We'll also configure **Firebase Performance Monitoring** so you can get some performance stats.
-
-Let's build a web app that displays, in _real time_, the tastiness of a burrito. Yum!
-
-To see the completed app, check out [this StackBlitz workspace](https://stackblitz.com/fork/reactfire-sample).
-
-## 1. Create a document in Cloud Firestore
-
-> If your project doesn't have a Cloud Firestore database instance yet, check out [these instructions](https://firebase.google.com/docs/firestore/quickstart#create) to create a new instance. Please initialize it in _locked mode_.
-
-1. Go to the _Database_ tab in the [Firebase console](https://console.firebase.google.com).
-
-1. Add a document.
-
- 1. In the _Data_ tab of the console, click _Add Collection_
-
- 1. Name the collection **_tryreactfire_**
- 1. Add a document with ID **_burrito_** and boolean field `yummy: true`
-
- 
-
-1. Add security rules to your document.
-
- 1. In the _Rules_ tab of the console, add the following security rules:
-
- ```text
- rules_version = '2';
- service cloud.firestore {
- match /databases/{database}/documents {
- match /tryreactfire/burrito {
- allow read, write: if true;
- }
- }
- }
- ```
-
- 2. _Publish_ the rules.
-
-## 2. Create a React App
-
-> Prerequisite: make sure you have [Node.js](https://nodejs.org/en/) installed.
-
-In a terminal, create a fresh React app in a directory of your choice.
-
-```shell
-npx create-react-app myapp
-cd myapp
-```
-
-## 3. Install ReactFire and the Firebase SDK
-
-> Ignore yarn/npm warnings.
-
-```bash
-yarn add firebase reactfire react@experimental react-dom@experimental
-
-# or
-
-npm install --save firebase reactfire react@experimental react-dom@experimental
-```
-
-⚠️ **Status: Experimental**. In order to use the feature of concurrent mode, [an experimental build of React is required](https://reactjs.org/docs/concurrent-mode-adoption.html#installation).
-
-## 4. Register your app with Firebase
-
-1. In the center of the Firebase console's project overview page, click the Web icon to launch the setup workflow.
-
- > If you've already added an app to your Firebase project, click _Add app_ to display the platform options.
-
-1. Enter your app's nickname.
-
- > Note: Firebase Hosting is not required for you to use Firebase products with your web app.
-
-1. _Register_ the app.
-
-1. Copy the Firebase configuration. This will be used in Step 4.
-
-1. _Continue to Console_
-
-## 5. Add Firebase to `index.js`
-
-> Open the src directory and add code to index.js as described below.
-
-1. Import from ReactFire
-
- ```js
- //...
- import { FirebaseAppProvider } from 'reactfire';
- //...
- ```
-
-1. Add the Firebase configuration
-
- > Add the firebaseConfig constant and paste the configuration from Step 3.
-
- ```jsx
- //...
- const firebaseConfig = {
- /* Paste your config object from Firebase console here */
- };
- //...
- ```
-
-1. Wrap your app in a `FirebaseAppProvider`
-
- > Replace the default render function.
-
- ```jsx
- //...
- ReactDOM.unstable_createRoot(document.getElementById('root')).render(
-
-
-
- );
- //...
- ```
-
-## 6. Add the `Burrito` function component to `App.js`
-
-> Open the src directory and add code to App.js as described below.
-
-1. Import from ReactFire
-
- ```js
- //...
- import { useFirestoreDocData, useFirestore, SuspenseWithPerf } from 'reactfire';
- //...
- ```
-
-1. Add a function component
-
- ```jsx
- //...
- function Burrito() {
- // lazy load the Firestore SDK and create a document reference
- const burritoRef = useFirestore()
- .collection('tryreactfire')
- .doc('burrito');
-
- // subscribe to the doc. just one line!
- const { data: burrito } = useFirestoreDocData(burritoRef);
-
- // get the value from the doc
- const isYummy = burrito.yummy;
-
- return
The burrito is {isYummy ? 'good' : 'bad'}
;
- }
- //...
- ```
-
-1. Render your component inside of a `Suspense` tag
-
-> We need to do this because `useFirestoreDocData` throws a Promise while it is waiting for a response from Firestore. Suspense will catch the Promise and render `fallback` until the Promise is resolved.
-
-Replace the `App` function with the following:
-
-```jsx
-//...
-function App() {
- return (
-
- {/*
- SuspenseWithPerf behaves the same as Suspense,
- but also automatically measures load times with the User Timing API
- and reports it to Firebase Performance Monitoring
- */}
-
-
-
-
- );
-}
-//...
-```
-
-## 7. Run your app!
-
-1. Run your app.
-
- ```bash
- yarn start
-
- # or
-
- npm run start
- ```
-
-1. Edit the value of `yummy` in the _Database_ tab in the [Firebase console](https://console.firebase.google.com) and watch it update in real time in your app! 🔥🔥🔥
-
-## _About Firebase Performance Monitoring_
-
-`SuspenseWithPerf` will lazy load the Firebase Performance Monitoring library and report on on our custom trace, `load-burrito-status`, that we set in the `traceId` prop of `SuspenseWithPerf`. In addition, it will automatically measure [common performance stats](https://firebase.google.com/docs/perf-mon/page-load-traces)!
-
-Note that Firebase Performance Monitoring can take about 12 hours to crunch your data and show it in the _Performance_ tab of the Firebase console.
-
-This is an example of some of the stats in the Firebase Performance Monitoring console after 12 hours:
-
-
-
-## _Next Steps_
-
-To explore information on using ReactFire, check out [Common Use Cases](https://github.com/FirebaseExtended/reactfire/blob/master/docs/use.md).
diff --git a/docs/quickstart.md b/docs/quickstart.md
index 2cf8723d..1632cfae 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -6,7 +6,7 @@ This quickstart shows you how to connect your React web app to **Cloud Firestore
Let's build a web app that displays, in _real time_, the tastiness of a burrito. Yum!
-To see the completed app, check out [this StackBlitz workspace](https://stackblitz.com/fork/reactfire-sample).
+To see the completed app, check out [this StackBlitz workspace](https://stackblitz.com/fork/reactfire-v4-sample).
## 1. Create a document in Cloud Firestore
@@ -79,11 +79,19 @@ npm install --save firebase reactfire
> Open the src directory and add code to index.js as described below.
+1. Import from the Firebase SDK
+
+ ```js
+ //...
+ import { doc, getFirestore } from 'firebase/firestore';
+ //...
+ ```
+
1. Import from ReactFire
```js
//...
- import { FirebaseAppProvider } from 'reactfire';
+ import { FirebaseAppProvider, FirestoreProvider, useFirestoreDocData, useFirestore, useFirebaseApp } from 'reactfire';
//...
```
@@ -132,11 +140,9 @@ npm install --save firebase reactfire
```jsx
//...
- function Burrito() {
+ function BurritoTaste() {
// easily access the Firestore library
- const burritoRef = useFirestore()
- .collection('tryreactfire')
- .doc('burrito');
+ const burritoRef = doc(useFirestore(), 'tryreactfire', 'burrito');
// subscribe to a document for realtime updates. just one line!
const { status, data } = useFirestoreDocData(burritoRef);
@@ -158,10 +164,12 @@ npm install --save firebase reactfire
```jsx
//...
function App() {
+ const firestoreInstance = getFirestore(useFirebaseApp());
return (
-
-
-
+
+
🌯
+
+
);
}
//...
diff --git a/docs/reference/README.md b/docs/reference/README.md
index 595e9e1e..fa4e3cd3 100644
--- a/docs/reference/README.md
+++ b/docs/reference/README.md
@@ -6,15 +6,15 @@ ReactFire reference docs
### Modules
-- [SuspenseSubject](modules/suspensesubject.md)
+- [SuspenseSubject](modules/SuspenseSubject.md)
- [auth](modules/auth.md)
- [database](modules/database.md)
-- [firebaseApp](modules/firebaseapp.md)
+- [firebaseApp](modules/firebaseApp.md)
- [firestore](modules/firestore.md)
- [index](modules/index.md)
- [performance](modules/performance.md)
- [remote-config](modules/remote_config.md)
-- [remote-config/getValue](modules/remote_config_getvalue.md)
+- [remote-config/getValue](modules/remote_config_getValue.md)
- [sdk](modules/sdk.md)
- [storage](modules/storage.md)
-- [useObservable](modules/useobservable.md)
+- [useObservable](modules/useObservable.md)
diff --git a/docs/reference/classes/suspensesubject.suspensesubject-1.md b/docs/reference/classes/SuspenseSubject.SuspenseSubject-1.md
similarity index 87%
rename from docs/reference/classes/suspensesubject.suspensesubject-1.md
rename to docs/reference/classes/SuspenseSubject.SuspenseSubject-1.md
index b4bf6b05..6e6444d2 100644
--- a/docs/reference/classes/suspensesubject.suspensesubject-1.md
+++ b/docs/reference/classes/SuspenseSubject.SuspenseSubject-1.md
@@ -1,8 +1,8 @@
-[ReactFire reference docs](../README.md) / [SuspenseSubject](../modules/suspensesubject.md) / SuspenseSubject
+[ReactFire reference docs](../README.md) / [SuspenseSubject](../modules/SuspenseSubject.md) / SuspenseSubject
# Class: SuspenseSubject
-[SuspenseSubject](../modules/suspensesubject.md).SuspenseSubject
+[SuspenseSubject](../modules/SuspenseSubject.md).SuspenseSubject
## Type parameters
@@ -20,51 +20,51 @@
### Constructors
-- [constructor](suspensesubject.suspensesubject-1.md#constructor)
+- [constructor](SuspenseSubject.SuspenseSubject-1.md#constructor)
### Properties
-- [\_error](suspensesubject.suspensesubject-1.md#_error)
-- [\_firstEmission](suspensesubject.suspensesubject-1.md#_firstemission)
-- [\_hasValue](suspensesubject.suspensesubject-1.md#_hasvalue)
-- [\_innerObservable](suspensesubject.suspensesubject-1.md#_innerobservable)
-- [\_innerSubscriber](suspensesubject.suspensesubject-1.md#_innersubscriber)
-- [\_resolveFirstEmission](suspensesubject.suspensesubject-1.md#_resolvefirstemission)
-- [\_timeoutHandler](suspensesubject.suspensesubject-1.md#_timeouthandler)
-- [\_value](suspensesubject.suspensesubject-1.md#_value)
-- [\_warmupSubscription](suspensesubject.suspensesubject-1.md#_warmupsubscription)
-- [closed](suspensesubject.suspensesubject-1.md#closed)
-- [hasError](suspensesubject.suspensesubject-1.md#haserror)
-- [isStopped](suspensesubject.suspensesubject-1.md#isstopped)
-- [observers](suspensesubject.suspensesubject-1.md#observers)
-- [operator](suspensesubject.suspensesubject-1.md#operator)
-- [source](suspensesubject.suspensesubject-1.md#source)
-- [thrownError](suspensesubject.suspensesubject-1.md#thrownerror)
-- [create](suspensesubject.suspensesubject-1.md#create)
+- [\_error](SuspenseSubject.SuspenseSubject-1.md#_error)
+- [\_firstEmission](SuspenseSubject.SuspenseSubject-1.md#_firstemission)
+- [\_hasValue](SuspenseSubject.SuspenseSubject-1.md#_hasvalue)
+- [\_innerObservable](SuspenseSubject.SuspenseSubject-1.md#_innerobservable)
+- [\_innerSubscriber](SuspenseSubject.SuspenseSubject-1.md#_innersubscriber)
+- [\_resolveFirstEmission](SuspenseSubject.SuspenseSubject-1.md#_resolvefirstemission)
+- [\_timeoutHandler](SuspenseSubject.SuspenseSubject-1.md#_timeouthandler)
+- [\_value](SuspenseSubject.SuspenseSubject-1.md#_value)
+- [\_warmupSubscription](SuspenseSubject.SuspenseSubject-1.md#_warmupsubscription)
+- [closed](SuspenseSubject.SuspenseSubject-1.md#closed)
+- [hasError](SuspenseSubject.SuspenseSubject-1.md#haserror)
+- [isStopped](SuspenseSubject.SuspenseSubject-1.md#isstopped)
+- [observers](SuspenseSubject.SuspenseSubject-1.md#observers)
+- [operator](SuspenseSubject.SuspenseSubject-1.md#operator)
+- [source](SuspenseSubject.SuspenseSubject-1.md#source)
+- [thrownError](SuspenseSubject.SuspenseSubject-1.md#thrownerror)
+- [create](SuspenseSubject.SuspenseSubject-1.md#create)
### Accessors
-- [firstEmission](suspensesubject.suspensesubject-1.md#firstemission)
-- [hasValue](suspensesubject.suspensesubject-1.md#hasvalue)
-- [observed](suspensesubject.suspensesubject-1.md#observed)
-- [ourError](suspensesubject.suspensesubject-1.md#ourerror)
-- [value](suspensesubject.suspensesubject-1.md#value)
+- [firstEmission](SuspenseSubject.SuspenseSubject-1.md#firstemission)
+- [hasValue](SuspenseSubject.SuspenseSubject-1.md#hasvalue)
+- [observed](SuspenseSubject.SuspenseSubject-1.md#observed)
+- [ourError](SuspenseSubject.SuspenseSubject-1.md#ourerror)
+- [value](SuspenseSubject.SuspenseSubject-1.md#value)
### Methods
-- [\_next](suspensesubject.suspensesubject-1.md#_next)
-- [\_reset](suspensesubject.suspensesubject-1.md#_reset)
-- [\_subscribe](suspensesubject.suspensesubject-1.md#_subscribe)
-- [asObservable](suspensesubject.suspensesubject-1.md#asobservable)
-- [complete](suspensesubject.suspensesubject-1.md#complete)
-- [error](suspensesubject.suspensesubject-1.md#error)
-- [forEach](suspensesubject.suspensesubject-1.md#foreach)
-- [lift](suspensesubject.suspensesubject-1.md#lift)
-- [next](suspensesubject.suspensesubject-1.md#next)
-- [pipe](suspensesubject.suspensesubject-1.md#pipe)
-- [subscribe](suspensesubject.suspensesubject-1.md#subscribe)
-- [toPromise](suspensesubject.suspensesubject-1.md#topromise)
-- [unsubscribe](suspensesubject.suspensesubject-1.md#unsubscribe)
+- [\_next](SuspenseSubject.SuspenseSubject-1.md#_next)
+- [\_reset](SuspenseSubject.SuspenseSubject-1.md#_reset)
+- [\_subscribe](SuspenseSubject.SuspenseSubject-1.md#_subscribe)
+- [asObservable](SuspenseSubject.SuspenseSubject-1.md#asobservable)
+- [complete](SuspenseSubject.SuspenseSubject-1.md#complete)
+- [error](SuspenseSubject.SuspenseSubject-1.md#error)
+- [forEach](SuspenseSubject.SuspenseSubject-1.md#foreach)
+- [lift](SuspenseSubject.SuspenseSubject-1.md#lift)
+- [next](SuspenseSubject.SuspenseSubject-1.md#next)
+- [pipe](SuspenseSubject.SuspenseSubject-1.md#pipe)
+- [subscribe](SuspenseSubject.SuspenseSubject-1.md#subscribe)
+- [toPromise](SuspenseSubject.SuspenseSubject-1.md#topromise)
+- [unsubscribe](SuspenseSubject.SuspenseSubject-1.md#unsubscribe)
## Constructors
@@ -91,7 +91,7 @@ Subject<T\>.constructor
#### Defined in
-[src/SuspenseSubject.ts:16](https://github.com/FirebaseExtended/reactfire/blob/main/src/SuspenseSubject.ts#L16)
+[src/SuspenseSubject.ts:18](https://github.com/FirebaseExtended/reactfire/blob/main/src/SuspenseSubject.ts#L18)
## Properties
@@ -307,12 +307,22 @@ ___
▪ `Static` **create**: (...`args`: `any`[]) => `any`
+Creates a "subject" by basically gluing an observer to an observable.
+
+**`nocollapse`**
+
+**`deprecated`** Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.
+
#### Type declaration
▸ (...`args`): `any`
Creates a "subject" by basically gluing an observer to an observable.
+**`nocollapse`**
+
+**`deprecated`** Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.
+
##### Parameters
| Name | Type |
diff --git a/docs/reference/classes/index.reactfireerror.md b/docs/reference/classes/index.ReactFireError.md
similarity index 77%
rename from docs/reference/classes/index.reactfireerror.md
rename to docs/reference/classes/index.ReactFireError.md
index 80ee48c8..09abdbe1 100644
--- a/docs/reference/classes/index.reactfireerror.md
+++ b/docs/reference/classes/index.ReactFireError.md
@@ -14,21 +14,21 @@
### Constructors
-- [constructor](index.reactfireerror.md#constructor)
+- [constructor](index.ReactFireError.md#constructor)
### Properties
-- [code](index.reactfireerror.md#code)
-- [customData](index.reactfireerror.md#customdata)
-- [message](index.reactfireerror.md#message)
-- [name](index.reactfireerror.md#name)
-- [stack](index.reactfireerror.md#stack)
-- [prepareStackTrace](index.reactfireerror.md#preparestacktrace)
-- [stackTraceLimit](index.reactfireerror.md#stacktracelimit)
+- [code](index.ReactFireError.md#code)
+- [customData](index.ReactFireError.md#customdata)
+- [message](index.ReactFireError.md#message)
+- [name](index.ReactFireError.md#name)
+- [stack](index.ReactFireError.md#stack)
+- [prepareStackTrace](index.ReactFireError.md#preparestacktrace)
+- [stackTraceLimit](index.ReactFireError.md#stacktracelimit)
### Methods
-- [captureStackTrace](index.reactfireerror.md#capturestacktrace)
+- [captureStackTrace](index.ReactFireError.md#capturestacktrace)
## Constructors
@@ -50,7 +50,7 @@ Error.constructor
#### Defined in
-[src/index.ts:11](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L11)
+[src/index.ts:15](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L15)
## Properties
@@ -90,7 +90,7 @@ Error.name
#### Defined in
-[src/index.ts:11](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L11)
+[src/index.ts:13](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L13)
___
diff --git a/docs/reference/interfaces/auth.authcheckprops.md b/docs/reference/interfaces/auth.AuthCheckProps.md
similarity index 50%
rename from docs/reference/interfaces/auth.authcheckprops.md
rename to docs/reference/interfaces/auth.AuthCheckProps.md
index 83af37e2..241dc75c 100644
--- a/docs/reference/interfaces/auth.authcheckprops.md
+++ b/docs/reference/interfaces/auth.AuthCheckProps.md
@@ -8,9 +8,9 @@
### Properties
-- [children](auth.authcheckprops.md#children)
-- [fallback](auth.authcheckprops.md#fallback)
-- [requiredClaims](auth.authcheckprops.md#requiredclaims)
+- [children](auth.AuthCheckProps.md#children)
+- [fallback](auth.AuthCheckProps.md#fallback)
+- [requiredClaims](auth.AuthCheckProps.md#requiredclaims)
## Properties
@@ -20,7 +20,7 @@
#### Defined in
-[src/auth.tsx:56](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L56)
+[src/auth.tsx:51](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L51)
___
@@ -30,7 +30,7 @@ ___
#### Defined in
-[src/auth.tsx:55](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L55)
+[src/auth.tsx:50](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L50)
___
@@ -40,4 +40,4 @@ ___
#### Defined in
-[src/auth.tsx:57](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L57)
+[src/auth.tsx:52](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L52)
diff --git a/docs/reference/interfaces/auth.claimcheckerrors.md b/docs/reference/interfaces/auth.ClaimCheckErrors.md
similarity index 100%
rename from docs/reference/interfaces/auth.claimcheckerrors.md
rename to docs/reference/interfaces/auth.ClaimCheckErrors.md
diff --git a/docs/reference/interfaces/auth.ClaimsCheckProps.md b/docs/reference/interfaces/auth.ClaimsCheckProps.md
new file mode 100644
index 00000000..877a5694
--- /dev/null
+++ b/docs/reference/interfaces/auth.ClaimsCheckProps.md
@@ -0,0 +1,58 @@
+[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / ClaimsCheckProps
+
+# Interface: ClaimsCheckProps
+
+[auth](../modules/auth.md).ClaimsCheckProps
+
+## Table of contents
+
+### Properties
+
+- [children](auth.ClaimsCheckProps.md#children)
+- [fallback](auth.ClaimsCheckProps.md#fallback)
+- [requiredClaims](auth.ClaimsCheckProps.md#requiredclaims)
+- [user](auth.ClaimsCheckProps.md#user)
+
+## Properties
+
+### children
+
+• **children**: `ReactNode`
+
+#### Defined in
+
+[src/auth.tsx:58](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L58)
+
+___
+
+### fallback
+
+• **fallback**: `ReactNode`
+
+#### Defined in
+
+[src/auth.tsx:57](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L57)
+
+___
+
+### requiredClaims
+
+• **requiredClaims**: `Object`
+
+#### Index signature
+
+▪ [key: `string`]: `any`
+
+#### Defined in
+
+[src/auth.tsx:59](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L59)
+
+___
+
+### user
+
+• **user**: `User`
+
+#### Defined in
+
+[src/auth.tsx:56](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L56)
diff --git a/docs/reference/interfaces/auth.claimsvalidator.md b/docs/reference/interfaces/auth.ClaimsValidator.md
similarity index 69%
rename from docs/reference/interfaces/auth.claimsvalidator.md
rename to docs/reference/interfaces/auth.ClaimsValidator.md
index 349d3e16..0ee7a537 100644
--- a/docs/reference/interfaces/auth.claimsvalidator.md
+++ b/docs/reference/interfaces/auth.ClaimsValidator.md
@@ -14,7 +14,7 @@
| Name | Type |
| :------ | :------ |
-| `claims` | `Object` |
+| `claims` | `ParsedToken` |
#### Returns
@@ -22,9 +22,9 @@
| Name | Type |
| :------ | :------ |
-| `errors` | {} \| [`ClaimCheckErrors`](auth.claimcheckerrors.md) |
+| `errors` | {} \| [`ClaimCheckErrors`](auth.ClaimCheckErrors.md) |
| `hasRequiredClaims` | `boolean` |
#### Defined in
-[src/auth.tsx:93](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L93)
+[src/auth.tsx:89](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L89)
diff --git a/docs/reference/interfaces/auth.SignInCheckOptionsBasic.md b/docs/reference/interfaces/auth.SignInCheckOptionsBasic.md
new file mode 100644
index 00000000..15b5f8b8
--- /dev/null
+++ b/docs/reference/interfaces/auth.SignInCheckOptionsBasic.md
@@ -0,0 +1,93 @@
+[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / SignInCheckOptionsBasic
+
+# Interface: SignInCheckOptionsBasic
+
+[auth](../modules/auth.md).SignInCheckOptionsBasic
+
+## Hierarchy
+
+- [`ReactFireOptions`](index.ReactFireOptions.md)<[`SigninCheckResult`](../modules/auth.md#signincheckresult)\>
+
+ ↳ **`SignInCheckOptionsBasic`**
+
+ ↳↳ [`SignInCheckOptionsClaimsObject`](auth.SignInCheckOptionsClaimsObject.md)
+
+ ↳↳ [`SignInCheckOptionsClaimsValidator`](auth.SignInCheckOptionsClaimsValidator.md)
+
+## Table of contents
+
+### Properties
+
+- [forceRefresh](auth.SignInCheckOptionsBasic.md#forcerefresh)
+- [idField](auth.SignInCheckOptionsBasic.md#idfield)
+- [initialData](auth.SignInCheckOptionsBasic.md#initialdata)
+- [startWithValue](auth.SignInCheckOptionsBasic.md#startwithvalue)
+- [suspense](auth.SignInCheckOptionsBasic.md#suspense)
+
+## Properties
+
+### forceRefresh
+
+• `Optional` **forceRefresh**: `boolean`
+
+#### Defined in
+
+[src/auth.tsx:81](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L81)
+
+___
+
+### idField
+
+• `Optional` **idField**: `string`
+
+#### Inherited from
+
+[ReactFireOptions](index.ReactFireOptions.md).[idField](index.ReactFireOptions.md#idfield)
+
+#### Defined in
+
+[src/index.ts:25](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L25)
+
+___
+
+### initialData
+
+• `Optional` **initialData**: `any`
+
+#### Inherited from
+
+[ReactFireOptions](index.ReactFireOptions.md).[initialData](index.ReactFireOptions.md#initialdata)
+
+#### Defined in
+
+[src/index.ts:26](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L26)
+
+___
+
+### startWithValue
+
+• `Optional` **startWithValue**: `any`
+
+**`deprecated`** use initialData instead
+
+#### Inherited from
+
+[ReactFireOptions](index.ReactFireOptions.md).[startWithValue](index.ReactFireOptions.md#startwithvalue)
+
+#### Defined in
+
+[src/index.ts:30](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L30)
+
+___
+
+### suspense
+
+• `Optional` **suspense**: `boolean`
+
+#### Inherited from
+
+[ReactFireOptions](index.ReactFireOptions.md).[suspense](index.ReactFireOptions.md#suspense)
+
+#### Defined in
+
+[src/index.ts:31](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L31)
diff --git a/docs/reference/interfaces/auth.SignInCheckOptionsClaimsObject.md b/docs/reference/interfaces/auth.SignInCheckOptionsClaimsObject.md
new file mode 100644
index 00000000..9af8617f
--- /dev/null
+++ b/docs/reference/interfaces/auth.SignInCheckOptionsClaimsObject.md
@@ -0,0 +1,104 @@
+[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / SignInCheckOptionsClaimsObject
+
+# Interface: SignInCheckOptionsClaimsObject
+
+[auth](../modules/auth.md).SignInCheckOptionsClaimsObject
+
+## Hierarchy
+
+- [`SignInCheckOptionsBasic`](auth.SignInCheckOptionsBasic.md)
+
+ ↳ **`SignInCheckOptionsClaimsObject`**
+
+## Table of contents
+
+### Properties
+
+- [forceRefresh](auth.SignInCheckOptionsClaimsObject.md#forcerefresh)
+- [idField](auth.SignInCheckOptionsClaimsObject.md#idfield)
+- [initialData](auth.SignInCheckOptionsClaimsObject.md#initialdata)
+- [requiredClaims](auth.SignInCheckOptionsClaimsObject.md#requiredclaims)
+- [startWithValue](auth.SignInCheckOptionsClaimsObject.md#startwithvalue)
+- [suspense](auth.SignInCheckOptionsClaimsObject.md#suspense)
+
+## Properties
+
+### forceRefresh
+
+• `Optional` **forceRefresh**: `boolean`
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[forceRefresh](auth.SignInCheckOptionsBasic.md#forcerefresh)
+
+#### Defined in
+
+[src/auth.tsx:81](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L81)
+
+___
+
+### idField
+
+• `Optional` **idField**: `string`
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[idField](auth.SignInCheckOptionsBasic.md#idfield)
+
+#### Defined in
+
+[src/index.ts:25](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L25)
+
+___
+
+### initialData
+
+• `Optional` **initialData**: `any`
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[initialData](auth.SignInCheckOptionsBasic.md#initialdata)
+
+#### Defined in
+
+[src/index.ts:26](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L26)
+
+___
+
+### requiredClaims
+
+• **requiredClaims**: `ParsedToken`
+
+#### Defined in
+
+[src/auth.tsx:85](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L85)
+
+___
+
+### startWithValue
+
+• `Optional` **startWithValue**: `any`
+
+**`deprecated`** use initialData instead
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[startWithValue](auth.SignInCheckOptionsBasic.md#startwithvalue)
+
+#### Defined in
+
+[src/index.ts:30](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L30)
+
+___
+
+### suspense
+
+• `Optional` **suspense**: `boolean`
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[suspense](auth.SignInCheckOptionsBasic.md#suspense)
+
+#### Defined in
+
+[src/index.ts:31](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L31)
diff --git a/docs/reference/interfaces/auth.SignInCheckOptionsClaimsValidator.md b/docs/reference/interfaces/auth.SignInCheckOptionsClaimsValidator.md
new file mode 100644
index 00000000..fd15382d
--- /dev/null
+++ b/docs/reference/interfaces/auth.SignInCheckOptionsClaimsValidator.md
@@ -0,0 +1,104 @@
+[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / SignInCheckOptionsClaimsValidator
+
+# Interface: SignInCheckOptionsClaimsValidator
+
+[auth](../modules/auth.md).SignInCheckOptionsClaimsValidator
+
+## Hierarchy
+
+- [`SignInCheckOptionsBasic`](auth.SignInCheckOptionsBasic.md)
+
+ ↳ **`SignInCheckOptionsClaimsValidator`**
+
+## Table of contents
+
+### Properties
+
+- [forceRefresh](auth.SignInCheckOptionsClaimsValidator.md#forcerefresh)
+- [idField](auth.SignInCheckOptionsClaimsValidator.md#idfield)
+- [initialData](auth.SignInCheckOptionsClaimsValidator.md#initialdata)
+- [startWithValue](auth.SignInCheckOptionsClaimsValidator.md#startwithvalue)
+- [suspense](auth.SignInCheckOptionsClaimsValidator.md#suspense)
+- [validateCustomClaims](auth.SignInCheckOptionsClaimsValidator.md#validatecustomclaims)
+
+## Properties
+
+### forceRefresh
+
+• `Optional` **forceRefresh**: `boolean`
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[forceRefresh](auth.SignInCheckOptionsBasic.md#forcerefresh)
+
+#### Defined in
+
+[src/auth.tsx:81](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L81)
+
+___
+
+### idField
+
+• `Optional` **idField**: `string`
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[idField](auth.SignInCheckOptionsBasic.md#idfield)
+
+#### Defined in
+
+[src/index.ts:25](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L25)
+
+___
+
+### initialData
+
+• `Optional` **initialData**: `any`
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[initialData](auth.SignInCheckOptionsBasic.md#initialdata)
+
+#### Defined in
+
+[src/index.ts:26](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L26)
+
+___
+
+### startWithValue
+
+• `Optional` **startWithValue**: `any`
+
+**`deprecated`** use initialData instead
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[startWithValue](auth.SignInCheckOptionsBasic.md#startwithvalue)
+
+#### Defined in
+
+[src/index.ts:30](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L30)
+
+___
+
+### suspense
+
+• `Optional` **suspense**: `boolean`
+
+#### Inherited from
+
+[SignInCheckOptionsBasic](auth.SignInCheckOptionsBasic.md).[suspense](auth.SignInCheckOptionsBasic.md#suspense)
+
+#### Defined in
+
+[src/index.ts:31](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L31)
+
+___
+
+### validateCustomClaims
+
+• **validateCustomClaims**: [`ClaimsValidator`](auth.ClaimsValidator.md)
+
+#### Defined in
+
+[src/auth.tsx:96](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L96)
diff --git a/docs/reference/interfaces/auth.claimscheckprops.md b/docs/reference/interfaces/auth.claimscheckprops.md
deleted file mode 100644
index 6feee640..00000000
--- a/docs/reference/interfaces/auth.claimscheckprops.md
+++ /dev/null
@@ -1,58 +0,0 @@
-[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / ClaimsCheckProps
-
-# Interface: ClaimsCheckProps
-
-[auth](../modules/auth.md).ClaimsCheckProps
-
-## Table of contents
-
-### Properties
-
-- [children](auth.claimscheckprops.md#children)
-- [fallback](auth.claimscheckprops.md#fallback)
-- [requiredClaims](auth.claimscheckprops.md#requiredclaims)
-- [user](auth.claimscheckprops.md#user)
-
-## Properties
-
-### children
-
-• **children**: `ReactNode`
-
-#### Defined in
-
-[src/auth.tsx:63](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L63)
-
-___
-
-### fallback
-
-• **fallback**: `ReactNode`
-
-#### Defined in
-
-[src/auth.tsx:62](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L62)
-
-___
-
-### requiredClaims
-
-• **requiredClaims**: `Object`
-
-#### Index signature
-
-▪ [key: `string`]: `any`
-
-#### Defined in
-
-[src/auth.tsx:64](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L64)
-
-___
-
-### user
-
-• **user**: `User`
-
-#### Defined in
-
-[src/auth.tsx:61](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L61)
diff --git a/docs/reference/interfaces/auth.signincheckoptionsbasic.md b/docs/reference/interfaces/auth.signincheckoptionsbasic.md
deleted file mode 100644
index 3bcd3861..00000000
--- a/docs/reference/interfaces/auth.signincheckoptionsbasic.md
+++ /dev/null
@@ -1,93 +0,0 @@
-[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / SignInCheckOptionsBasic
-
-# Interface: SignInCheckOptionsBasic
-
-[auth](../modules/auth.md).SignInCheckOptionsBasic
-
-## Hierarchy
-
-- [`ReactFireOptions`](index.reactfireoptions.md)<[`SigninCheckResult`](../modules/auth.md#signincheckresult)\>
-
- ↳ **`SignInCheckOptionsBasic`**
-
- ↳↳ [`SignInCheckOptionsClaimsObject`](auth.signincheckoptionsclaimsobject.md)
-
- ↳↳ [`SignInCheckOptionsClaimsValidator`](auth.signincheckoptionsclaimsvalidator.md)
-
-## Table of contents
-
-### Properties
-
-- [forceRefresh](auth.signincheckoptionsbasic.md#forcerefresh)
-- [idField](auth.signincheckoptionsbasic.md#idfield)
-- [initialData](auth.signincheckoptionsbasic.md#initialdata)
-- [startWithValue](auth.signincheckoptionsbasic.md#startwithvalue)
-- [suspense](auth.signincheckoptionsbasic.md#suspense)
-
-## Properties
-
-### forceRefresh
-
-• `Optional` **forceRefresh**: `boolean`
-
-#### Defined in
-
-[src/auth.tsx:86](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L86)
-
-___
-
-### idField
-
-• `Optional` **idField**: `string`
-
-#### Inherited from
-
-[ReactFireOptions](index.reactfireoptions.md).[idField](index.reactfireoptions.md#idfield)
-
-#### Defined in
-
-[src/index.ts:23](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L23)
-
-___
-
-### initialData
-
-• `Optional` **initialData**: `any`
-
-#### Inherited from
-
-[ReactFireOptions](index.reactfireoptions.md).[initialData](index.reactfireoptions.md#initialdata)
-
-#### Defined in
-
-[src/index.ts:24](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L24)
-
-___
-
-### startWithValue
-
-• `Optional` **startWithValue**: `any`
-
-**`deprecated`** use initialData instead
-
-#### Inherited from
-
-[ReactFireOptions](index.reactfireoptions.md).[startWithValue](index.reactfireoptions.md#startwithvalue)
-
-#### Defined in
-
-[src/index.ts:28](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L28)
-
-___
-
-### suspense
-
-• `Optional` **suspense**: `boolean`
-
-#### Inherited from
-
-[ReactFireOptions](index.reactfireoptions.md).[suspense](index.reactfireoptions.md#suspense)
-
-#### Defined in
-
-[src/index.ts:29](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L29)
diff --git a/docs/reference/interfaces/auth.signincheckoptionsclaimsobject.md b/docs/reference/interfaces/auth.signincheckoptionsclaimsobject.md
deleted file mode 100644
index 7b34b552..00000000
--- a/docs/reference/interfaces/auth.signincheckoptionsclaimsobject.md
+++ /dev/null
@@ -1,108 +0,0 @@
-[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / SignInCheckOptionsClaimsObject
-
-# Interface: SignInCheckOptionsClaimsObject
-
-[auth](../modules/auth.md).SignInCheckOptionsClaimsObject
-
-## Hierarchy
-
-- [`SignInCheckOptionsBasic`](auth.signincheckoptionsbasic.md)
-
- ↳ **`SignInCheckOptionsClaimsObject`**
-
-## Table of contents
-
-### Properties
-
-- [forceRefresh](auth.signincheckoptionsclaimsobject.md#forcerefresh)
-- [idField](auth.signincheckoptionsclaimsobject.md#idfield)
-- [initialData](auth.signincheckoptionsclaimsobject.md#initialdata)
-- [requiredClaims](auth.signincheckoptionsclaimsobject.md#requiredclaims)
-- [startWithValue](auth.signincheckoptionsclaimsobject.md#startwithvalue)
-- [suspense](auth.signincheckoptionsclaimsobject.md#suspense)
-
-## Properties
-
-### forceRefresh
-
-• `Optional` **forceRefresh**: `boolean`
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[forceRefresh](auth.signincheckoptionsbasic.md#forcerefresh)
-
-#### Defined in
-
-[src/auth.tsx:86](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L86)
-
-___
-
-### idField
-
-• `Optional` **idField**: `string`
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[idField](auth.signincheckoptionsbasic.md#idfield)
-
-#### Defined in
-
-[src/index.ts:23](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L23)
-
-___
-
-### initialData
-
-• `Optional` **initialData**: `any`
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[initialData](auth.signincheckoptionsbasic.md#initialdata)
-
-#### Defined in
-
-[src/index.ts:24](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L24)
-
-___
-
-### requiredClaims
-
-• **requiredClaims**: `Object`
-
-#### Index signature
-
-▪ [key: `string`]: `any`
-
-#### Defined in
-
-[src/auth.tsx:90](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L90)
-
-___
-
-### startWithValue
-
-• `Optional` **startWithValue**: `any`
-
-**`deprecated`** use initialData instead
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[startWithValue](auth.signincheckoptionsbasic.md#startwithvalue)
-
-#### Defined in
-
-[src/index.ts:28](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L28)
-
-___
-
-### suspense
-
-• `Optional` **suspense**: `boolean`
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[suspense](auth.signincheckoptionsbasic.md#suspense)
-
-#### Defined in
-
-[src/index.ts:29](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L29)
diff --git a/docs/reference/interfaces/auth.signincheckoptionsclaimsvalidator.md b/docs/reference/interfaces/auth.signincheckoptionsclaimsvalidator.md
deleted file mode 100644
index 3588c414..00000000
--- a/docs/reference/interfaces/auth.signincheckoptionsclaimsvalidator.md
+++ /dev/null
@@ -1,104 +0,0 @@
-[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / SignInCheckOptionsClaimsValidator
-
-# Interface: SignInCheckOptionsClaimsValidator
-
-[auth](../modules/auth.md).SignInCheckOptionsClaimsValidator
-
-## Hierarchy
-
-- [`SignInCheckOptionsBasic`](auth.signincheckoptionsbasic.md)
-
- ↳ **`SignInCheckOptionsClaimsValidator`**
-
-## Table of contents
-
-### Properties
-
-- [forceRefresh](auth.signincheckoptionsclaimsvalidator.md#forcerefresh)
-- [idField](auth.signincheckoptionsclaimsvalidator.md#idfield)
-- [initialData](auth.signincheckoptionsclaimsvalidator.md#initialdata)
-- [startWithValue](auth.signincheckoptionsclaimsvalidator.md#startwithvalue)
-- [suspense](auth.signincheckoptionsclaimsvalidator.md#suspense)
-- [validateCustomClaims](auth.signincheckoptionsclaimsvalidator.md#validatecustomclaims)
-
-## Properties
-
-### forceRefresh
-
-• `Optional` **forceRefresh**: `boolean`
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[forceRefresh](auth.signincheckoptionsbasic.md#forcerefresh)
-
-#### Defined in
-
-[src/auth.tsx:86](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L86)
-
-___
-
-### idField
-
-• `Optional` **idField**: `string`
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[idField](auth.signincheckoptionsbasic.md#idfield)
-
-#### Defined in
-
-[src/index.ts:23](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L23)
-
-___
-
-### initialData
-
-• `Optional` **initialData**: `any`
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[initialData](auth.signincheckoptionsbasic.md#initialdata)
-
-#### Defined in
-
-[src/index.ts:24](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L24)
-
-___
-
-### startWithValue
-
-• `Optional` **startWithValue**: `any`
-
-**`deprecated`** use initialData instead
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[startWithValue](auth.signincheckoptionsbasic.md#startwithvalue)
-
-#### Defined in
-
-[src/index.ts:28](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L28)
-
-___
-
-### suspense
-
-• `Optional` **suspense**: `boolean`
-
-#### Inherited from
-
-[SignInCheckOptionsBasic](auth.signincheckoptionsbasic.md).[suspense](auth.signincheckoptionsbasic.md#suspense)
-
-#### Defined in
-
-[src/index.ts:29](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L29)
-
-___
-
-### validateCustomClaims
-
-• **validateCustomClaims**: [`ClaimsValidator`](auth.claimsvalidator.md)
-
-#### Defined in
-
-[src/auth.tsx:101](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L101)
diff --git a/docs/reference/interfaces/index.reactfireoptions.md b/docs/reference/interfaces/index.ReactFireOptions.md
similarity index 52%
rename from docs/reference/interfaces/index.reactfireoptions.md
rename to docs/reference/interfaces/index.ReactFireOptions.md
index cbef4a5f..65521be0 100644
--- a/docs/reference/interfaces/index.reactfireoptions.md
+++ b/docs/reference/interfaces/index.ReactFireOptions.md
@@ -14,16 +14,16 @@
- **`ReactFireOptions`**
- ↳ [`SignInCheckOptionsBasic`](auth.signincheckoptionsbasic.md)
+ ↳ [`SignInCheckOptionsBasic`](auth.SignInCheckOptionsBasic.md)
## Table of contents
### Properties
-- [idField](index.reactfireoptions.md#idfield)
-- [initialData](index.reactfireoptions.md#initialdata)
-- [startWithValue](index.reactfireoptions.md#startwithvalue)
-- [suspense](index.reactfireoptions.md#suspense)
+- [idField](index.ReactFireOptions.md#idfield)
+- [initialData](index.ReactFireOptions.md#initialdata)
+- [startWithValue](index.ReactFireOptions.md#startwithvalue)
+- [suspense](index.ReactFireOptions.md#suspense)
## Properties
@@ -33,7 +33,7 @@
#### Defined in
-[src/index.ts:23](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L23)
+[src/index.ts:25](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L25)
___
@@ -43,7 +43,7 @@ ___
#### Defined in
-[src/index.ts:24](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L24)
+[src/index.ts:26](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L26)
___
@@ -55,7 +55,7 @@ ___
#### Defined in
-[src/index.ts:28](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L28)
+[src/index.ts:30](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L30)
___
@@ -65,4 +65,4 @@ ___
#### Defined in
-[src/index.ts:29](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L29)
+[src/index.ts:31](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L31)
diff --git a/docs/reference/interfaces/performance.SuspensePerfProps.md b/docs/reference/interfaces/performance.SuspensePerfProps.md
new file mode 100644
index 00000000..852373db
--- /dev/null
+++ b/docs/reference/interfaces/performance.SuspensePerfProps.md
@@ -0,0 +1,43 @@
+[ReactFire reference docs](../README.md) / [performance](../modules/performance.md) / SuspensePerfProps
+
+# Interface: SuspensePerfProps
+
+[performance](../modules/performance.md).SuspensePerfProps
+
+## Table of contents
+
+### Properties
+
+- [children](performance.SuspensePerfProps.md#children)
+- [fallback](performance.SuspensePerfProps.md#fallback)
+- [traceId](performance.SuspensePerfProps.md#traceid)
+
+## Properties
+
+### children
+
+• **children**: `ReactNode`
+
+#### Defined in
+
+[src/performance.tsx:4](https://github.com/FirebaseExtended/reactfire/blob/main/src/performance.tsx#L4)
+
+___
+
+### fallback
+
+• **fallback**: `ReactNode`
+
+#### Defined in
+
+[src/performance.tsx:6](https://github.com/FirebaseExtended/reactfire/blob/main/src/performance.tsx#L6)
+
+___
+
+### traceId
+
+• **traceId**: `string`
+
+#### Defined in
+
+[src/performance.tsx:5](https://github.com/FirebaseExtended/reactfire/blob/main/src/performance.tsx#L5)
diff --git a/docs/reference/interfaces/performance.suspenseperfprops.md b/docs/reference/interfaces/performance.suspenseperfprops.md
deleted file mode 100644
index 2198c8ec..00000000
--- a/docs/reference/interfaces/performance.suspenseperfprops.md
+++ /dev/null
@@ -1,54 +0,0 @@
-[ReactFire reference docs](../README.md) / [performance](../modules/performance.md) / SuspensePerfProps
-
-# Interface: SuspensePerfProps
-
-[performance](../modules/performance.md).SuspensePerfProps
-
-## Table of contents
-
-### Properties
-
-- [children](performance.suspenseperfprops.md#children)
-- [fallback](performance.suspenseperfprops.md#fallback)
-- [firePerf](performance.suspenseperfprops.md#fireperf)
-- [traceId](performance.suspenseperfprops.md#traceid)
-
-## Properties
-
-### children
-
-• **children**: `ReactNode`
-
-#### Defined in
-
-[src/performance.tsx:6](https://github.com/FirebaseExtended/reactfire/blob/main/src/performance.tsx#L6)
-
-___
-
-### fallback
-
-• **fallback**: `ReactNode`
-
-#### Defined in
-
-[src/performance.tsx:8](https://github.com/FirebaseExtended/reactfire/blob/main/src/performance.tsx#L8)
-
-___
-
-### firePerf
-
-• `Optional` **firePerf**: `Performance`
-
-#### Defined in
-
-[src/performance.tsx:9](https://github.com/FirebaseExtended/reactfire/blob/main/src/performance.tsx#L9)
-
-___
-
-### traceId
-
-• **traceId**: `string`
-
-#### Defined in
-
-[src/performance.tsx:7](https://github.com/FirebaseExtended/reactfire/blob/main/src/performance.tsx#L7)
diff --git a/docs/reference/interfaces/useobservable.observablestatus.md b/docs/reference/interfaces/useObservable.ObservableStatus.md
similarity index 82%
rename from docs/reference/interfaces/useobservable.observablestatus.md
rename to docs/reference/interfaces/useObservable.ObservableStatus.md
index 907f7ae0..33bad7c8 100644
--- a/docs/reference/interfaces/useobservable.observablestatus.md
+++ b/docs/reference/interfaces/useObservable.ObservableStatus.md
@@ -1,8 +1,8 @@
-[ReactFire reference docs](../README.md) / [useObservable](../modules/useobservable.md) / ObservableStatus
+[ReactFire reference docs](../README.md) / [useObservable](../modules/useObservable.md) / ObservableStatus
# Interface: ObservableStatus
-[useObservable](../modules/useobservable.md).ObservableStatus
+[useObservable](../modules/useObservable.md).ObservableStatus
## Type parameters
@@ -14,12 +14,12 @@
### Properties
-- [data](useobservable.observablestatus.md#data)
-- [error](useobservable.observablestatus.md#error)
-- [firstValuePromise](useobservable.observablestatus.md#firstvaluepromise)
-- [hasEmitted](useobservable.observablestatus.md#hasemitted)
-- [isComplete](useobservable.observablestatus.md#iscomplete)
-- [status](useobservable.observablestatus.md#status)
+- [data](useObservable.ObservableStatus.md#data)
+- [error](useObservable.ObservableStatus.md#error)
+- [firstValuePromise](useObservable.ObservableStatus.md#firstvaluepromise)
+- [hasEmitted](useObservable.ObservableStatus.md#hasemitted)
+- [isComplete](useObservable.ObservableStatus.md#iscomplete)
+- [status](useObservable.ObservableStatus.md#status)
## Properties
diff --git a/docs/reference/modules/suspensesubject.md b/docs/reference/modules/SuspenseSubject.md
similarity index 66%
rename from docs/reference/modules/suspensesubject.md
rename to docs/reference/modules/SuspenseSubject.md
index 4441adc4..b0b355b9 100644
--- a/docs/reference/modules/suspensesubject.md
+++ b/docs/reference/modules/SuspenseSubject.md
@@ -6,4 +6,4 @@
### Classes
-- [SuspenseSubject](../classes/suspensesubject.suspensesubject-1.md)
+- [SuspenseSubject](../classes/SuspenseSubject.SuspenseSubject-1.md)
diff --git a/docs/reference/modules/auth.md b/docs/reference/modules/auth.md
index 586cedd5..bbf545b5 100644
--- a/docs/reference/modules/auth.md
+++ b/docs/reference/modules/auth.md
@@ -6,13 +6,13 @@
### Interfaces
-- [AuthCheckProps](../interfaces/auth.authcheckprops.md)
-- [ClaimCheckErrors](../interfaces/auth.claimcheckerrors.md)
-- [ClaimsCheckProps](../interfaces/auth.claimscheckprops.md)
-- [ClaimsValidator](../interfaces/auth.claimsvalidator.md)
-- [SignInCheckOptionsBasic](../interfaces/auth.signincheckoptionsbasic.md)
-- [SignInCheckOptionsClaimsObject](../interfaces/auth.signincheckoptionsclaimsobject.md)
-- [SignInCheckOptionsClaimsValidator](../interfaces/auth.signincheckoptionsclaimsvalidator.md)
+- [AuthCheckProps](../interfaces/auth.AuthCheckProps.md)
+- [ClaimCheckErrors](../interfaces/auth.ClaimCheckErrors.md)
+- [ClaimsCheckProps](../interfaces/auth.ClaimsCheckProps.md)
+- [ClaimsValidator](../interfaces/auth.ClaimsValidator.md)
+- [SignInCheckOptionsBasic](../interfaces/auth.SignInCheckOptionsBasic.md)
+- [SignInCheckOptionsClaimsObject](../interfaces/auth.SignInCheckOptionsClaimsObject.md)
+- [SignInCheckOptionsClaimsValidator](../interfaces/auth.SignInCheckOptionsClaimsValidator.md)
### Type aliases
@@ -31,11 +31,11 @@
### SigninCheckResult
-Ƭ **SigninCheckResult**: { `errors`: {} ; `hasRequiredClaims`: ``false`` ; `signedIn`: ``false`` ; `user`: ``null`` } \| { `errors`: [`ClaimCheckErrors`](../interfaces/auth.claimcheckerrors.md) ; `hasRequiredClaims`: `boolean` ; `signedIn`: ``true`` ; `user`: `firebase.User` }
+Ƭ **SigninCheckResult**: { `errors`: {} ; `hasRequiredClaims`: ``false`` ; `signedIn`: ``false`` ; `user`: ``null`` } \| { `errors`: [`ClaimCheckErrors`](../interfaces/auth.ClaimCheckErrors.md) ; `hasRequiredClaims`: `boolean` ; `signedIn`: ``true`` ; `user`: `User` }
#### Defined in
-[src/auth.tsx:71](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L71)
+[src/auth.tsx:66](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L66)
## Functions
@@ -53,7 +53,7 @@ Meant for Concurrent mode only (``). [More
| Name | Type |
| :------ | :------ |
-| `__namedParameters` | [`AuthCheckProps`](../interfaces/auth.authcheckprops.md) |
+| `__namedParameters` | [`AuthCheckProps`](../interfaces/auth.AuthCheckProps.md) |
#### Returns
@@ -61,7 +61,7 @@ Meant for Concurrent mode only (``). [More
#### Defined in
-[src/auth.tsx:248](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L248)
+[src/auth.tsx:247](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L247)
___
@@ -79,7 +79,7 @@ Meant for Concurrent mode only (``). [More
| Name | Type |
| :------ | :------ |
-| `__namedParameters` | [`ClaimsCheckProps`](../interfaces/auth.claimscheckprops.md) |
+| `__namedParameters` | [`ClaimsCheckProps`](../interfaces/auth.ClaimsCheckProps.md) |
#### Returns
@@ -87,20 +87,19 @@ Meant for Concurrent mode only (``). [More
#### Defined in
-[src/auth.tsx:211](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L211)
+[src/auth.tsx:210](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L210)
___
### preloadUser
-▸ **preloadUser**(`options`): `Promise`<`undefined` \| ``null`` \| `User`\>
+▸ **preloadUser**(`authResolver`): `Promise`<`undefined` \| ``null`` \| `User`\>
#### Parameters
| Name | Type |
| :------ | :------ |
-| `options` | `Object` |
-| `options.firebaseApp` | `firebase.app.App` |
+| `authResolver` | () => `Promise`<`Auth`\> |
#### Returns
@@ -108,35 +107,35 @@ ___
#### Defined in
-[src/auth.tsx:9](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L9)
+[src/auth.tsx:11](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L11)
___
### useIdTokenResult
-▸ **useIdTokenResult**(`user`, `forceRefresh?`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.auth.IdTokenResult`\>
+▸ **useIdTokenResult**(`user`, `forceRefresh?`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`IdTokenResult`\>
#### Parameters
| Name | Type | Default value |
| :------ | :------ | :------ |
-| `user` | `firebase.User` | `undefined` |
+| `user` | `User` | `undefined` |
| `forceRefresh` | `boolean` | `false` |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`firebase.auth.IdTokenResult`\> | `undefined` |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`IdTokenResult`\> | `undefined` |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.auth.IdTokenResult`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`IdTokenResult`\>
#### Defined in
-[src/auth.tsx:39](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L39)
+[src/auth.tsx:38](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L38)
___
### useSigninCheck
-▸ **useSigninCheck**(`options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<[`SigninCheckResult`](auth.md#signincheckresult)\>
+▸ **useSigninCheck**(`options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<[`SigninCheckResult`](auth.md#signincheckresult)\>
Subscribe to the signed-in status of a user.
@@ -172,21 +171,21 @@ const {status, data: signInCheckResult} = useSignInCheck({forceRefresh: true, re
| Name | Type |
| :------ | :------ |
-| `options?` | [`SignInCheckOptionsBasic`](../interfaces/auth.signincheckoptionsbasic.md) \| [`SignInCheckOptionsClaimsObject`](../interfaces/auth.signincheckoptionsclaimsobject.md) \| [`SignInCheckOptionsClaimsValidator`](../interfaces/auth.signincheckoptionsclaimsvalidator.md) |
+| `options?` | [`SignInCheckOptionsBasic`](../interfaces/auth.SignInCheckOptionsBasic.md) \| [`SignInCheckOptionsClaimsObject`](../interfaces/auth.SignInCheckOptionsClaimsObject.md) \| [`SignInCheckOptionsClaimsValidator`](../interfaces/auth.SignInCheckOptionsClaimsValidator.md) |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<[`SigninCheckResult`](auth.md#signincheckresult)\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<[`SigninCheckResult`](auth.md#signincheckresult)\>
#### Defined in
-[src/auth.tsx:136](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L136)
+[src/auth.tsx:131](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L131)
___
### useUser
-▸ **useUser**<`T`\>(`options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.User`\>
+▸ **useUser**<`T`\>(`options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`User` \| ``null``\>
Subscribe to Firebase auth state changes, including token refresh
@@ -200,12 +199,12 @@ Subscribe to Firebase auth state changes, including token refresh
| Name | Type |
| :------ | :------ |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`\> |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.User`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`User` \| ``null``\>
#### Defined in
-[src/auth.tsx:23](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L23)
+[src/auth.tsx:22](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L22)
diff --git a/docs/reference/modules/database.md b/docs/reference/modules/database.md
index ab99ed62..7024785e 100644
--- a/docs/reference/modules/database.md
+++ b/docs/reference/modules/database.md
@@ -15,7 +15,7 @@
### useDatabaseList
-▸ **useDatabaseList**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`QueryChange`[] \| `T`[]\>
+▸ **useDatabaseList**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`QueryChange`[] \| `T`[]\>
Subscribe to a Realtime Database list
@@ -29,22 +29,22 @@ Subscribe to a Realtime Database list
| Name | Type | Description |
| :------ | :------ | :------ |
-| `ref` | `firebase.database.Reference` \| `firebase.database.Query` | Reference to the DB List you want to listen to |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`[]\> | |
+| `ref` | `DatabaseReference` \| `DatabaseQuery` | Reference to the DB List you want to listen to |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`[]\> | |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`QueryChange`[] \| `T`[]\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`QueryChange`[] \| `T`[]\>
#### Defined in
-[src/database.tsx:73](https://github.com/FirebaseExtended/reactfire/blob/main/src/database.tsx#L73)
+[src/database.tsx:74](https://github.com/FirebaseExtended/reactfire/blob/main/src/database.tsx#L74)
___
### useDatabaseListData
-▸ **useDatabaseListData**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`[]\>
+▸ **useDatabaseListData**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`[] \| ``null``\>
#### Type parameters
@@ -56,22 +56,22 @@ ___
| Name | Type |
| :------ | :------ |
-| `ref` | `firebase.database.Reference` \| `firebase.database.Query` |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`[]\> |
+| `ref` | `DatabaseReference` \| `DatabaseQuery` |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`[]\> |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`[]\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`[] \| ``null``\>
#### Defined in
-[src/database.tsx:83](https://github.com/FirebaseExtended/reactfire/blob/main/src/database.tsx#L83)
+[src/database.tsx:84](https://github.com/FirebaseExtended/reactfire/blob/main/src/database.tsx#L84)
___
### useDatabaseObject
-▸ **useDatabaseObject**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`QueryChange` \| `T`\>
+▸ **useDatabaseObject**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`QueryChange` \| `T`\>
Subscribe to a Realtime Database object
@@ -85,22 +85,22 @@ Subscribe to a Realtime Database object
| Name | Type | Description |
| :------ | :------ | :------ |
-| `ref` | `firebase.database.Reference` | Reference to the DB object you want to listen to |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`\> | |
+| `ref` | `DatabaseReference` | Reference to the DB object you want to listen to |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`\> | |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`QueryChange` \| `T`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`QueryChange` \| `T`\>
#### Defined in
-[src/database.tsx:29](https://github.com/FirebaseExtended/reactfire/blob/main/src/database.tsx#L29)
+[src/database.tsx:30](https://github.com/FirebaseExtended/reactfire/blob/main/src/database.tsx#L30)
___
### useDatabaseObjectData
-▸ **useDatabaseObjectData**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`\>
+▸ **useDatabaseObjectData**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`\>
#### Type parameters
@@ -112,13 +112,13 @@ ___
| Name | Type |
| :------ | :------ |
-| `ref` | `firebase.database.Reference` |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`\> |
+| `ref` | `DatabaseReference` |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`\> |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`\>
#### Defined in
-[src/database.tsx:59](https://github.com/FirebaseExtended/reactfire/blob/main/src/database.tsx#L59)
+[src/database.tsx:60](https://github.com/FirebaseExtended/reactfire/blob/main/src/database.tsx#L60)
diff --git a/docs/reference/modules/firebaseApp.md b/docs/reference/modules/firebaseApp.md
new file mode 100644
index 00000000..36401679
--- /dev/null
+++ b/docs/reference/modules/firebaseApp.md
@@ -0,0 +1,94 @@
+[ReactFire reference docs](../README.md) / firebaseApp
+
+# Module: firebaseApp
+
+## Table of contents
+
+### Variables
+
+- [version](firebaseApp.md#version)
+
+### Functions
+
+- [FirebaseAppProvider](firebaseApp.md#firebaseappprovider)
+- [useFirebaseApp](firebaseApp.md#usefirebaseapp)
+- [useIsSuspenseEnabled](firebaseApp.md#useissuspenseenabled)
+- [useSuspenseEnabledFromConfigAndContext](firebaseApp.md#usesuspenseenabledfromconfigandcontext)
+
+## Variables
+
+### version
+
+• `Const` **version**: `any`
+
+#### Defined in
+
+[src/firebaseApp.tsx:20](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L20)
+
+## Functions
+
+### FirebaseAppProvider
+
+▸ **FirebaseAppProvider**(`props`): `Element`
+
+#### Parameters
+
+| Name | Type |
+| :------ | :------ |
+| `props` | `React.PropsWithChildren`<`FirebaseAppProviderProps`\> |
+
+#### Returns
+
+`Element`
+
+#### Defined in
+
+[src/firebaseApp.tsx:24](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L24)
+
+___
+
+### useFirebaseApp
+
+▸ **useFirebaseApp**(): `FirebaseApp`
+
+#### Returns
+
+`FirebaseApp`
+
+#### Defined in
+
+[src/firebaseApp.tsx:78](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L78)
+
+___
+
+### useIsSuspenseEnabled
+
+▸ **useIsSuspenseEnabled**(): `boolean`
+
+#### Returns
+
+`boolean`
+
+#### Defined in
+
+[src/firebaseApp.tsx:60](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L60)
+
+___
+
+### useSuspenseEnabledFromConfigAndContext
+
+▸ **useSuspenseEnabledFromConfigAndContext**(`suspenseFromConfig?`): `boolean`
+
+#### Parameters
+
+| Name | Type |
+| :------ | :------ |
+| `suspenseFromConfig?` | `boolean` |
+
+#### Returns
+
+`boolean`
+
+#### Defined in
+
+[src/firebaseApp.tsx:67](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L67)
diff --git a/docs/reference/modules/firebaseapp.md b/docs/reference/modules/firebaseapp.md
deleted file mode 100644
index 9afa9115..00000000
--- a/docs/reference/modules/firebaseapp.md
+++ /dev/null
@@ -1,230 +0,0 @@
-[ReactFire reference docs](../README.md) / firebaseApp
-
-# Module: firebaseApp
-
-## Table of contents
-
-### References
-
-- [PreloadOptions](firebaseapp.md#preloadoptions)
-- [preloadAnalytics](firebaseapp.md#preloadanalytics)
-- [preloadAuth](firebaseapp.md#preloadauth)
-- [preloadDatabase](firebaseapp.md#preloaddatabase)
-- [preloadFirestore](firebaseapp.md#preloadfirestore)
-- [preloadFunctions](firebaseapp.md#preloadfunctions)
-- [preloadMessaging](firebaseapp.md#preloadmessaging)
-- [preloadPerformance](firebaseapp.md#preloadperformance)
-- [preloadRemoteConfig](firebaseapp.md#preloadremoteconfig)
-- [preloadStorage](firebaseapp.md#preloadstorage)
-- [useAnalytics](firebaseapp.md#useanalytics)
-- [useAuth](firebaseapp.md#useauth)
-- [useDatabase](firebaseapp.md#usedatabase)
-- [useFirestore](firebaseapp.md#usefirestore)
-- [useFunctions](firebaseapp.md#usefunctions)
-- [useMessaging](firebaseapp.md#usemessaging)
-- [usePerformance](firebaseapp.md#useperformance)
-- [useRemoteConfig](firebaseapp.md#useremoteconfig)
-- [useStorage](firebaseapp.md#usestorage)
-
-### Variables
-
-- [version](firebaseapp.md#version)
-
-### Functions
-
-- [FirebaseAppProvider](firebaseapp.md#firebaseappprovider)
-- [useFirebaseApp](firebaseapp.md#usefirebaseapp)
-- [useIsSuspenseEnabled](firebaseapp.md#useissuspenseenabled)
-- [useSuspenseEnabledFromConfigAndContext](firebaseapp.md#usesuspenseenabledfromconfigandcontext)
-
-## References
-
-### PreloadOptions
-
-Re-exports: [PreloadOptions](sdk.md#preloadoptions)
-
-___
-
-### preloadAnalytics
-
-Re-exports: [preloadAnalytics](sdk.md#preloadanalytics)
-
-___
-
-### preloadAuth
-
-Re-exports: [preloadAuth](sdk.md#preloadauth)
-
-___
-
-### preloadDatabase
-
-Re-exports: [preloadDatabase](sdk.md#preloaddatabase)
-
-___
-
-### preloadFirestore
-
-Re-exports: [preloadFirestore](sdk.md#preloadfirestore)
-
-___
-
-### preloadFunctions
-
-Re-exports: [preloadFunctions](sdk.md#preloadfunctions)
-
-___
-
-### preloadMessaging
-
-Re-exports: [preloadMessaging](sdk.md#preloadmessaging)
-
-___
-
-### preloadPerformance
-
-Re-exports: [preloadPerformance](sdk.md#preloadperformance)
-
-___
-
-### preloadRemoteConfig
-
-Re-exports: [preloadRemoteConfig](sdk.md#preloadremoteconfig)
-
-___
-
-### preloadStorage
-
-Re-exports: [preloadStorage](sdk.md#preloadstorage)
-
-___
-
-### useAnalytics
-
-Re-exports: [useAnalytics](sdk.md#useanalytics)
-
-___
-
-### useAuth
-
-Re-exports: [useAuth](sdk.md#useauth)
-
-___
-
-### useDatabase
-
-Re-exports: [useDatabase](sdk.md#usedatabase)
-
-___
-
-### useFirestore
-
-Re-exports: [useFirestore](sdk.md#usefirestore)
-
-___
-
-### useFunctions
-
-Re-exports: [useFunctions](sdk.md#usefunctions)
-
-___
-
-### useMessaging
-
-Re-exports: [useMessaging](sdk.md#usemessaging)
-
-___
-
-### usePerformance
-
-Re-exports: [usePerformance](sdk.md#useperformance)
-
-___
-
-### useRemoteConfig
-
-Re-exports: [useRemoteConfig](sdk.md#useremoteconfig)
-
-___
-
-### useStorage
-
-Re-exports: [useStorage](sdk.md#usestorage)
-
-## Variables
-
-### version
-
-• `Const` **version**: `any`
-
-#### Defined in
-
-[src/firebaseApp.tsx:23](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L23)
-
-## Functions
-
-### FirebaseAppProvider
-
-▸ **FirebaseAppProvider**(`props`): `Element`
-
-#### Parameters
-
-| Name | Type |
-| :------ | :------ |
-| `props` | `Props` & { [key: string]: `unknown`; } |
-
-#### Returns
-
-`Element`
-
-#### Defined in
-
-[src/firebaseApp.tsx:27](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L27)
-
-___
-
-### useFirebaseApp
-
-▸ **useFirebaseApp**(): `App`
-
-#### Returns
-
-`App`
-
-#### Defined in
-
-[src/firebaseApp.tsx:82](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L82)
-
-___
-
-### useIsSuspenseEnabled
-
-▸ **useIsSuspenseEnabled**(): `boolean`
-
-#### Returns
-
-`boolean`
-
-#### Defined in
-
-[src/firebaseApp.tsx:64](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L64)
-
-___
-
-### useSuspenseEnabledFromConfigAndContext
-
-▸ **useSuspenseEnabledFromConfigAndContext**(`suspenseFromConfig?`): `boolean`
-
-#### Parameters
-
-| Name | Type |
-| :------ | :------ |
-| `suspenseFromConfig?` | `boolean` |
-
-#### Returns
-
-`boolean`
-
-#### Defined in
-
-[src/firebaseApp.tsx:71](https://github.com/FirebaseExtended/reactfire/blob/main/src/firebaseApp.tsx#L71)
diff --git a/docs/reference/modules/firestore.md b/docs/reference/modules/firestore.md
index fe3c5cf0..bf3a9e23 100644
--- a/docs/reference/modules/firestore.md
+++ b/docs/reference/modules/firestore.md
@@ -18,19 +18,21 @@
### preloadFirestoreDoc
-▸ **preloadFirestoreDoc**(`refProvider`, `options`): `Promise`<[`SuspenseSubject`](../classes/suspensesubject.suspensesubject-1.md)<`DocumentSnapshot`<`DocumentData`\>\>\>
+▸ **preloadFirestoreDoc**(`refProvider`): `Promise`<[`SuspenseSubject`](../classes/SuspenseSubject.SuspenseSubject-1.md)<`DocumentSnapshot`<`DocumentData`\>\>\>
+
+Preload a subscription to a Firestore document reference.
+
+Use this to warm up `useFirestoreDoc` for a specific document
#### Parameters
| Name | Type |
| :------ | :------ |
-| `refProvider` | (`firestore`: `firebase.firestore.Firestore`) => `firebase.firestore.DocumentReference` |
-| `options` | `Object` |
-| `options.firebaseApp` | `firebase.app.App` |
+| `refProvider` | () => `Promise`<`DocumentReference`\> |
#### Returns
-`Promise`<[`SuspenseSubject`](../classes/suspensesubject.suspensesubject-1.md)<`DocumentSnapshot`<`DocumentData`\>\>\>
+`Promise`<[`SuspenseSubject`](../classes/SuspenseSubject.SuspenseSubject-1.md)<`DocumentSnapshot`<`DocumentData`\>\>\>
#### Defined in
@@ -40,7 +42,7 @@ ___
### useFirestoreCollection
-▸ **useFirestoreCollection**<`T`\>(`query`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.firestore.QuerySnapshot`<`T`\>\>
+▸ **useFirestoreCollection**<`T`\>(`query`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`QuerySnapshot`<`T`\>\>
Subscribe to a Firestore collection
@@ -54,54 +56,56 @@ Subscribe to a Firestore collection
| Name | Type |
| :------ | :------ |
-| `query` | `firebase.firestore.Query` |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`[]\> |
+| `query` | `FirestoreQuery`<`T`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`[]\> |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.firestore.QuerySnapshot`<`T`\>\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`QuerySnapshot`<`T`\>\>
#### Defined in
-[src/firestore.tsx:108](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L108)
+[src/firestore.tsx:86](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L86)
___
### useFirestoreCollectionData
-▸ **useFirestoreCollectionData**<`T`\>(`query`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`[]\>
+▸ **useFirestoreCollectionData**<`T`\>(`query`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`[]\>
-Subscribe to a Firestore collection and unwrap the snapshot.
+Subscribe to a Firestore collection and unwrap the snapshot into an array.
#### Type parameters
| Name | Type |
| :------ | :------ |
-| `T` | { [key: string]: `unknown`; } |
+| `T` | `DocumentData` |
#### Parameters
| Name | Type |
| :------ | :------ |
-| `query` | `firebase.firestore.Query` |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`[]\> |
+| `query` | `FirestoreQuery`<`T`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`[]\> |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`[]\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`[]\>
#### Defined in
-[src/firestore.tsx:124](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L124)
+[src/firestore.tsx:96](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L96)
___
### useFirestoreDoc
-▸ **useFirestoreDoc**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.firestore.DocumentSnapshot`<`T`\>\>
+▸ **useFirestoreDoc**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`DocumentSnapshot`<`T`\>\>
Suscribe to Firestore Document changes
+You can preload data for this hook by calling `preloadFirestoreDoc`
+
#### Type parameters
| Name | Type |
@@ -110,55 +114,55 @@ Suscribe to Firestore Document changes
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `ref` | `firebase.firestore.DocumentReference` | Reference to the document you want to listen to |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`\> | |
+| Name | Type |
+| :------ | :------ |
+| `ref` | `DocumentReference`<`T`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`\> |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.firestore.DocumentSnapshot`<`T`\>\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`DocumentSnapshot`<`T`\>\>
#### Defined in
-[src/firestore.tsx:46](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L46)
+[src/firestore.tsx:42](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L42)
___
### useFirestoreDocData
-▸ **useFirestoreDocData**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`\>
+▸ **useFirestoreDocData**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`\>
-Suscribe to Firestore Document changes
+Suscribe to Firestore Document changes and unwrap the document into a plain object
#### Type parameters
-| Name |
-| :------ |
-| `T` |
+| Name | Type |
+| :------ | :------ |
+| `T` | `unknown` |
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `ref` | `firebase.firestore.DocumentReference` | Reference to the document you want to listen to |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`\> | |
+| Name | Type |
+| :------ | :------ |
+| `ref` | `DocumentReference`<`T`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`\> |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`\>
#### Defined in
-[src/firestore.tsx:78](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L78)
+[src/firestore.tsx:62](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L62)
___
### useFirestoreDocDataOnce
-▸ **useFirestoreDocDataOnce**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`\>
+▸ **useFirestoreDocDataOnce**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`\>
-Get a firestore document and don't subscribe to changes
+Get a Firestore document, unwrap the document into a plain object, and don't subscribe to changes
#### Type parameters
@@ -168,24 +172,24 @@ Get a firestore document and don't subscribe to changes
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `ref` | `firebase.firestore.DocumentReference` | Reference to the document you want to get |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`\> | |
+| Name | Type |
+| :------ | :------ |
+| `ref` | `DocumentReference`<`T`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`\> |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`\>
#### Defined in
-[src/firestore.tsx:93](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L93)
+[src/firestore.tsx:74](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L74)
___
### useFirestoreDocOnce
-▸ **useFirestoreDocOnce**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T` extends {} ? `T` : `firebase.firestore.DocumentSnapshot`\>
+▸ **useFirestoreDocOnce**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`DocumentSnapshot`<`T`\>\>
Get a firestore document and don't subscribe to changes
@@ -193,19 +197,19 @@ Get a firestore document and don't subscribe to changes
| Name | Type |
| :------ | :------ |
-| `T` | `unknown` |
+| `T` | `DocumentData` |
#### Parameters
-| Name | Type | Description |
-| :------ | :------ | :------ |
-| `ref` | `firebase.firestore.DocumentReference` | Reference to the document you want to get |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`\> | |
+| Name | Type |
+| :------ | :------ |
+| `ref` | `DocumentReference`<`T`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`\> |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T` extends {} ? `T` : `firebase.firestore.DocumentSnapshot`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`DocumentSnapshot`<`T`\>\>
#### Defined in
-[src/firestore.tsx:62](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L62)
+[src/firestore.tsx:52](https://github.com/FirebaseExtended/reactfire/blob/main/src/firestore.tsx#L52)
diff --git a/docs/reference/modules/index.md b/docs/reference/modules/index.md
index 31504b3d..76d53357 100644
--- a/docs/reference/modules/index.md
+++ b/docs/reference/modules/index.md
@@ -8,33 +8,28 @@
- [AuthCheck](index.md#authcheck)
- [AuthCheckProps](index.md#authcheckprops)
+- [AuthProvider](index.md#authprovider)
- [ClaimCheckErrors](index.md#claimcheckerrors)
- [ClaimsCheck](index.md#claimscheck)
- [ClaimsCheckProps](index.md#claimscheckprops)
- [ClaimsValidator](index.md#claimsvalidator)
+- [DatabaseProvider](index.md#databaseprovider)
- [FirebaseAppProvider](index.md#firebaseappprovider)
+- [FirestoreProvider](index.md#firestoreprovider)
- [ObservableStatus](index.md#observablestatus)
-- [PreloadOptions](index.md#preloadoptions)
+- [PerformanceProvider](index.md#performanceprovider)
+- [RemoteConfigProvider](index.md#remoteconfigprovider)
- [SignInCheckOptionsBasic](index.md#signincheckoptionsbasic)
- [SignInCheckOptionsClaimsObject](index.md#signincheckoptionsclaimsobject)
- [SignInCheckOptionsClaimsValidator](index.md#signincheckoptionsclaimsvalidator)
- [SigninCheckResult](index.md#signincheckresult)
- [StorageImage](index.md#storageimage)
+- [StorageProvider](index.md#storageprovider)
- [SuspensePerfProps](index.md#suspenseperfprops)
- [SuspenseWithPerf](index.md#suspensewithperf)
-- [preloadAnalytics](index.md#preloadanalytics)
-- [preloadAuth](index.md#preloadauth)
-- [preloadDatabase](index.md#preloaddatabase)
-- [preloadFirestore](index.md#preloadfirestore)
- [preloadFirestoreDoc](index.md#preloadfirestoredoc)
-- [preloadFunctions](index.md#preloadfunctions)
-- [preloadMessaging](index.md#preloadmessaging)
- [preloadObservable](index.md#preloadobservable)
-- [preloadPerformance](index.md#preloadperformance)
-- [preloadRemoteConfig](index.md#preloadremoteconfig)
-- [preloadStorage](index.md#preloadstorage)
- [preloadUser](index.md#preloaduser)
-- [useAnalytics](index.md#useanalytics)
- [useAuth](index.md#useauth)
- [useDatabase](index.md#usedatabase)
- [useDatabaseList](index.md#usedatabaselist)
@@ -49,10 +44,14 @@
- [useFirestoreDocData](index.md#usefirestoredocdata)
- [useFirestoreDocDataOnce](index.md#usefirestoredocdataonce)
- [useFirestoreDocOnce](index.md#usefirestoredoconce)
-- [useFunctions](index.md#usefunctions)
- [useIdTokenResult](index.md#useidtokenresult)
+- [useInitAuth](index.md#useinitauth)
+- [useInitDatabase](index.md#useinitdatabase)
+- [useInitFirestore](index.md#useinitfirestore)
+- [useInitPerformance](index.md#useinitperformance)
+- [useInitRemoteConfig](index.md#useinitremoteconfig)
+- [useInitStorage](index.md#useinitstorage)
- [useIsSuspenseEnabled](index.md#useissuspenseenabled)
-- [useMessaging](index.md#usemessaging)
- [useObservable](index.md#useobservable)
- [usePerformance](index.md#useperformance)
- [useRemoteConfig](index.md#useremoteconfig)
@@ -71,11 +70,11 @@
### Classes
-- [ReactFireError](../classes/index.reactfireerror.md)
+- [ReactFireError](../classes/index.ReactFireError.md)
### Interfaces
-- [ReactFireOptions](../interfaces/index.reactfireoptions.md)
+- [ReactFireOptions](../interfaces/index.ReactFireOptions.md)
### Type aliases
@@ -97,13 +96,19 @@ ___
### AuthCheckProps
-Re-exports: [AuthCheckProps](../interfaces/auth.authcheckprops.md)
+Re-exports: [AuthCheckProps](../interfaces/auth.AuthCheckProps.md)
+
+___
+
+### AuthProvider
+
+Re-exports: [AuthProvider](sdk.md#authprovider)
___
### ClaimCheckErrors
-Re-exports: [ClaimCheckErrors](../interfaces/auth.claimcheckerrors.md)
+Re-exports: [ClaimCheckErrors](../interfaces/auth.ClaimCheckErrors.md)
___
@@ -115,97 +120,97 @@ ___
### ClaimsCheckProps
-Re-exports: [ClaimsCheckProps](../interfaces/auth.claimscheckprops.md)
+Re-exports: [ClaimsCheckProps](../interfaces/auth.ClaimsCheckProps.md)
___
### ClaimsValidator
-Re-exports: [ClaimsValidator](../interfaces/auth.claimsvalidator.md)
+Re-exports: [ClaimsValidator](../interfaces/auth.ClaimsValidator.md)
___
-### FirebaseAppProvider
+### DatabaseProvider
-Re-exports: [FirebaseAppProvider](firebaseapp.md#firebaseappprovider)
+Re-exports: [DatabaseProvider](sdk.md#databaseprovider)
___
-### ObservableStatus
+### FirebaseAppProvider
-Re-exports: [ObservableStatus](../interfaces/useobservable.observablestatus.md)
+Re-exports: [FirebaseAppProvider](firebaseApp.md#firebaseappprovider)
___
-### PreloadOptions
+### FirestoreProvider
-Re-exports: [PreloadOptions](sdk.md#preloadoptions)
+Re-exports: [FirestoreProvider](sdk.md#firestoreprovider)
___
-### SignInCheckOptionsBasic
+### ObservableStatus
-Re-exports: [SignInCheckOptionsBasic](../interfaces/auth.signincheckoptionsbasic.md)
+Re-exports: [ObservableStatus](../interfaces/useObservable.ObservableStatus.md)
___
-### SignInCheckOptionsClaimsObject
+### PerformanceProvider
-Re-exports: [SignInCheckOptionsClaimsObject](../interfaces/auth.signincheckoptionsclaimsobject.md)
+Re-exports: [PerformanceProvider](sdk.md#performanceprovider)
___
-### SignInCheckOptionsClaimsValidator
+### RemoteConfigProvider
-Re-exports: [SignInCheckOptionsClaimsValidator](../interfaces/auth.signincheckoptionsclaimsvalidator.md)
+Re-exports: [RemoteConfigProvider](sdk.md#remoteconfigprovider)
___
-### SigninCheckResult
+### SignInCheckOptionsBasic
-Re-exports: [SigninCheckResult](auth.md#signincheckresult)
+Re-exports: [SignInCheckOptionsBasic](../interfaces/auth.SignInCheckOptionsBasic.md)
___
-### StorageImage
+### SignInCheckOptionsClaimsObject
-Re-exports: [StorageImage](storage.md#storageimage)
+Re-exports: [SignInCheckOptionsClaimsObject](../interfaces/auth.SignInCheckOptionsClaimsObject.md)
___
-### SuspensePerfProps
+### SignInCheckOptionsClaimsValidator
-Re-exports: [SuspensePerfProps](../interfaces/performance.suspenseperfprops.md)
+Re-exports: [SignInCheckOptionsClaimsValidator](../interfaces/auth.SignInCheckOptionsClaimsValidator.md)
___
-### SuspenseWithPerf
+### SigninCheckResult
-Re-exports: [SuspenseWithPerf](performance.md#suspensewithperf)
+Re-exports: [SigninCheckResult](auth.md#signincheckresult)
___
-### preloadAnalytics
+### StorageImage
-Re-exports: [preloadAnalytics](sdk.md#preloadanalytics)
+Re-exports: [StorageImage](storage.md#storageimage)
___
-### preloadAuth
+### StorageProvider
-Re-exports: [preloadAuth](sdk.md#preloadauth)
+Re-exports: [StorageProvider](sdk.md#storageprovider)
___
-### preloadDatabase
+### SuspensePerfProps
-Re-exports: [preloadDatabase](sdk.md#preloaddatabase)
+Re-exports: [SuspensePerfProps](../interfaces/performance.SuspensePerfProps.md)
___
-### preloadFirestore
+### SuspenseWithPerf
-Re-exports: [preloadFirestore](sdk.md#preloadfirestore)
+Re-exports: [SuspenseWithPerf](performance.md#suspensewithperf)
___
@@ -215,39 +220,9 @@ Re-exports: [preloadFirestoreDoc](firestore.md#preloadfirestoredoc)
___
-### preloadFunctions
-
-Re-exports: [preloadFunctions](sdk.md#preloadfunctions)
-
-___
-
-### preloadMessaging
-
-Re-exports: [preloadMessaging](sdk.md#preloadmessaging)
-
-___
-
### preloadObservable
-Re-exports: [preloadObservable](useobservable.md#preloadobservable)
-
-___
-
-### preloadPerformance
-
-Re-exports: [preloadPerformance](sdk.md#preloadperformance)
-
-___
-
-### preloadRemoteConfig
-
-Re-exports: [preloadRemoteConfig](sdk.md#preloadremoteconfig)
-
-___
-
-### preloadStorage
-
-Re-exports: [preloadStorage](sdk.md#preloadstorage)
+Re-exports: [preloadObservable](useObservable.md#preloadobservable)
___
@@ -257,12 +232,6 @@ Re-exports: [preloadUser](auth.md#preloaduser)
___
-### useAnalytics
-
-Re-exports: [useAnalytics](sdk.md#useanalytics)
-
-___
-
### useAuth
Re-exports: [useAuth](sdk.md#useauth)
@@ -301,7 +270,7 @@ ___
### useFirebaseApp
-Re-exports: [useFirebaseApp](firebaseapp.md#usefirebaseapp)
+Re-exports: [useFirebaseApp](firebaseApp.md#usefirebaseapp)
___
@@ -347,33 +316,57 @@ Re-exports: [useFirestoreDocOnce](firestore.md#usefirestoredoconce)
___
-### useFunctions
+### useIdTokenResult
-Re-exports: [useFunctions](sdk.md#usefunctions)
+Re-exports: [useIdTokenResult](auth.md#useidtokenresult)
___
-### useIdTokenResult
+### useInitAuth
-Re-exports: [useIdTokenResult](auth.md#useidtokenresult)
+Re-exports: [useInitAuth](sdk.md#useinitauth)
___
-### useIsSuspenseEnabled
+### useInitDatabase
+
+Re-exports: [useInitDatabase](sdk.md#useinitdatabase)
+
+___
+
+### useInitFirestore
+
+Re-exports: [useInitFirestore](sdk.md#useinitfirestore)
+
+___
+
+### useInitPerformance
-Re-exports: [useIsSuspenseEnabled](firebaseapp.md#useissuspenseenabled)
+Re-exports: [useInitPerformance](sdk.md#useinitperformance)
___
-### useMessaging
+### useInitRemoteConfig
+
+Re-exports: [useInitRemoteConfig](sdk.md#useinitremoteconfig)
+
+___
+
+### useInitStorage
+
+Re-exports: [useInitStorage](sdk.md#useinitstorage)
+
+___
+
+### useIsSuspenseEnabled
-Re-exports: [useMessaging](sdk.md#usemessaging)
+Re-exports: [useIsSuspenseEnabled](firebaseApp.md#useissuspenseenabled)
___
### useObservable
-Re-exports: [useObservable](useobservable.md#useobservable)
+Re-exports: [useObservable](useObservable.md#useobservable)
___
@@ -445,7 +438,7 @@ ___
### useSuspenseEnabledFromConfigAndContext
-Re-exports: [useSuspenseEnabledFromConfigAndContext](firebaseapp.md#usesuspenseenabledfromconfigandcontext)
+Re-exports: [useSuspenseEnabledFromConfigAndContext](firebaseApp.md#usesuspenseenabledfromconfigandcontext)
___
@@ -457,7 +450,7 @@ ___
### version
-Re-exports: [version](firebaseapp.md#version)
+Re-exports: [version](firebaseApp.md#version)
## Type aliases
@@ -469,13 +462,13 @@ Re-exports: [version](firebaseapp.md#version)
| Name | Type |
| :------ | :------ |
-| `_reactFireDatabaseCachedQueries` | `firebase.database.Query`[] |
-| `_reactFireFirestoreQueryCache` | `firebase.firestore.Query`[] |
-| `_reactFirePreloadedObservables` | `Map`<`string`, [`SuspenseSubject`](../classes/suspensesubject.suspensesubject-1.md)<`any`\>\> |
+| `_reactFireDatabaseCachedQueries` | `DatabaseQuery`[] |
+| `_reactFireFirestoreQueryCache` | `FirestoreQuery`[] |
+| `_reactFirePreloadedObservables` | `Map`<`string`, [`SuspenseSubject`](../classes/SuspenseSubject.SuspenseSubject-1.md)<`any`\>\> |
#### Defined in
-[src/index.ts:4](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L4)
+[src/index.ts:6](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L6)
## Functions
@@ -487,7 +480,7 @@ Re-exports: [version](firebaseapp.md#version)
| Name | Type |
| :------ | :------ |
-| `options` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md) |
+| `options` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md) |
#### Returns
@@ -495,7 +488,7 @@ Re-exports: [version](firebaseapp.md#version)
#### Defined in
-[src/index.ts:45](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L45)
+[src/index.ts:47](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L47)
___
@@ -507,7 +500,7 @@ ___
| Name | Type |
| :------ | :------ |
-| `options` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md) |
+| `options` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md) |
| `field` | `string` |
#### Returns
@@ -516,7 +509,7 @@ ___
#### Defined in
-[src/index.ts:32](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L32)
+[src/index.ts:34](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L34)
___
@@ -528,7 +521,7 @@ ___
| Name | Type |
| :------ | :------ |
-| `options` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md) |
+| `options` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md) |
#### Returns
@@ -536,4 +529,4 @@ ___
#### Defined in
-[src/index.ts:41](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L41)
+[src/index.ts:43](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L43)
diff --git a/docs/reference/modules/performance.md b/docs/reference/modules/performance.md
index 279214ac..e68a38a0 100644
--- a/docs/reference/modules/performance.md
+++ b/docs/reference/modules/performance.md
@@ -6,7 +6,7 @@
### Interfaces
-- [SuspensePerfProps](../interfaces/performance.suspenseperfprops.md)
+- [SuspensePerfProps](../interfaces/performance.SuspensePerfProps.md)
### Functions
@@ -22,7 +22,7 @@
| Name | Type |
| :------ | :------ |
-| `__namedParameters` | [`SuspensePerfProps`](../interfaces/performance.suspenseperfprops.md) |
+| `__namedParameters` | [`SuspensePerfProps`](../interfaces/performance.SuspensePerfProps.md) |
#### Returns
@@ -30,4 +30,4 @@
#### Defined in
-[src/performance.tsx:12](https://github.com/FirebaseExtended/reactfire/blob/main/src/performance.tsx#L12)
+[src/performance.tsx:9](https://github.com/FirebaseExtended/reactfire/blob/main/src/performance.tsx#L9)
diff --git a/docs/reference/modules/remote_config.md b/docs/reference/modules/remote_config.md
index 06fb8754..54b3641a 100644
--- a/docs/reference/modules/remote_config.md
+++ b/docs/reference/modules/remote_config.md
@@ -16,7 +16,7 @@
### useRemoteConfigAll
-▸ **useRemoteConfigAll**(`key`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<[`AllParameters`](remote_config_getvalue.md#allparameters)\>
+▸ **useRemoteConfigAll**(`key`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<[`AllParameters`](remote_config_getValue.md#allparameters)\>
Convience method similar to useRemoteConfigValue. Returns allRemote Config parameters.
@@ -28,7 +28,7 @@ Convience method similar to useRemoteConfigValue. Returns allRemote Config param
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<[`AllParameters`](remote_config_getvalue.md#allparameters)\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<[`AllParameters`](remote_config_getValue.md#allparameters)\>
#### Defined in
@@ -38,7 +38,7 @@ ___
### useRemoteConfigBoolean
-▸ **useRemoteConfigBoolean**(`key`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`boolean`\>
+▸ **useRemoteConfigBoolean**(`key`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`boolean`\>
Convience method similar to useRemoteConfigValue. Returns a `boolean` from a Remote Config parameter.
@@ -50,7 +50,7 @@ Convience method similar to useRemoteConfigValue. Returns a `boolean` from a Rem
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`boolean`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`boolean`\>
#### Defined in
@@ -60,7 +60,7 @@ ___
### useRemoteConfigNumber
-▸ **useRemoteConfigNumber**(`key`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`number`\>
+▸ **useRemoteConfigNumber**(`key`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`number`\>
Convience method similar to useRemoteConfigValue. Returns a `number` from a Remote Config parameter.
@@ -72,7 +72,7 @@ Convience method similar to useRemoteConfigValue. Returns a `number` from a Remo
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`number`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`number`\>
#### Defined in
@@ -82,7 +82,7 @@ ___
### useRemoteConfigString
-▸ **useRemoteConfigString**(`key`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`string`\>
+▸ **useRemoteConfigString**(`key`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`string`\>
Convience method similar to useRemoteConfigValue. Returns a `string` from a Remote Config parameter.
@@ -94,7 +94,7 @@ Convience method similar to useRemoteConfigValue. Returns a `string` from a Remo
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`string`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`string`\>
#### Defined in
@@ -104,7 +104,7 @@ ___
### useRemoteConfigValue
-▸ **useRemoteConfigValue**(`key`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`RemoteConfigValue`\>
+▸ **useRemoteConfigValue**(`key`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`RemoteConfigValue`\>
Accepts a key and optionally a Remote Config instance. Returns a
Remote Config Value.
@@ -117,7 +117,7 @@ Remote Config Value.
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`RemoteConfigValue`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`RemoteConfigValue`\>
#### Defined in
diff --git a/docs/reference/modules/remote_config_getvalue.md b/docs/reference/modules/remote_config_getValue.md
similarity index 56%
rename from docs/reference/modules/remote_config_getvalue.md
rename to docs/reference/modules/remote_config_getValue.md
index f9eb8ff1..a27faa49 100644
--- a/docs/reference/modules/remote_config_getvalue.md
+++ b/docs/reference/modules/remote_config_getValue.md
@@ -6,15 +6,15 @@
### Type aliases
-- [AllParameters](remote_config_getvalue.md#allparameters)
+- [AllParameters](remote_config_getValue.md#allparameters)
### Functions
-- [getAll](remote_config_getvalue.md#getall)
-- [getBoolean](remote_config_getvalue.md#getboolean)
-- [getNumber](remote_config_getvalue.md#getnumber)
-- [getString](remote_config_getvalue.md#getstring)
-- [getValue](remote_config_getvalue.md#getvalue)
+- [getAll](remote_config_getValue.md#getall)
+- [getBoolean](remote_config_getValue.md#getboolean)
+- [getNumber](remote_config_getValue.md#getnumber)
+- [getString](remote_config_getValue.md#getstring)
+- [getValue](remote_config_getValue.md#getvalue)
## Type aliases
@@ -28,13 +28,13 @@
#### Defined in
-[src/remote-config/getValue.tsx:6](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L6)
+[src/remote-config/getValue.tsx:13](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L13)
## Functions
### getAll
-▸ **getAll**(`remoteConfig`): `Observable`<[`AllParameters`](remote_config_getvalue.md#allparameters)\>
+▸ **getAll**(`remoteConfig`): `Observable`<[`AllParameters`](remote_config_getValue.md#allparameters)\>
#### Parameters
@@ -44,11 +44,11 @@
#### Returns
-`Observable`<[`AllParameters`](remote_config_getvalue.md#allparameters)\>
+`Observable`<[`AllParameters`](remote_config_getValue.md#allparameters)\>
#### Defined in
-[src/remote-config/getValue.tsx:47](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L47)
+[src/remote-config/getValue.tsx:54](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L54)
___
@@ -69,7 +69,7 @@ ___
#### Defined in
-[src/remote-config/getValue.tsx:42](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L42)
+[src/remote-config/getValue.tsx:49](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L49)
___
@@ -90,7 +90,7 @@ ___
#### Defined in
-[src/remote-config/getValue.tsx:37](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L37)
+[src/remote-config/getValue.tsx:44](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L44)
___
@@ -111,7 +111,7 @@ ___
#### Defined in
-[src/remote-config/getValue.tsx:32](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L32)
+[src/remote-config/getValue.tsx:39](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L39)
___
@@ -132,4 +132,4 @@ ___
#### Defined in
-[src/remote-config/getValue.tsx:27](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L27)
+[src/remote-config/getValue.tsx:34](https://github.com/FirebaseExtended/reactfire/blob/main/src/remote-config/getValue.tsx#L34)
diff --git a/docs/reference/modules/sdk.md b/docs/reference/modules/sdk.md
index 26103987..e4307334 100644
--- a/docs/reference/modules/sdk.md
+++ b/docs/reference/modules/sdk.md
@@ -4,344 +4,353 @@
## Table of contents
-### Type aliases
-
-- [PreloadOptions](sdk.md#preloadoptions)
-
-### Variables
+### Functions
-- [useAnalytics](sdk.md#useanalytics)
+- [AuthProvider](sdk.md#authprovider)
+- [DatabaseProvider](sdk.md#databaseprovider)
+- [FirestoreProvider](sdk.md#firestoreprovider)
+- [PerformanceProvider](sdk.md#performanceprovider)
+- [RemoteConfigProvider](sdk.md#remoteconfigprovider)
+- [StorageProvider](sdk.md#storageprovider)
- [useAuth](sdk.md#useauth)
- [useDatabase](sdk.md#usedatabase)
- [useFirestore](sdk.md#usefirestore)
-- [useFunctions](sdk.md#usefunctions)
-- [useMessaging](sdk.md#usemessaging)
-- [useStorage](sdk.md#usestorage)
-
-### Functions
-
-- [preloadAnalytics](sdk.md#preloadanalytics)
-- [preloadAuth](sdk.md#preloadauth)
-- [preloadDatabase](sdk.md#preloaddatabase)
-- [preloadFirestore](sdk.md#preloadfirestore)
-- [preloadFunctions](sdk.md#preloadfunctions)
-- [preloadMessaging](sdk.md#preloadmessaging)
-- [preloadPerformance](sdk.md#preloadperformance)
-- [preloadRemoteConfig](sdk.md#preloadremoteconfig)
-- [preloadStorage](sdk.md#preloadstorage)
+- [useInitAuth](sdk.md#useinitauth)
+- [useInitDatabase](sdk.md#useinitdatabase)
+- [useInitFirestore](sdk.md#useinitfirestore)
+- [useInitPerformance](sdk.md#useinitperformance)
+- [useInitRemoteConfig](sdk.md#useinitremoteconfig)
+- [useInitStorage](sdk.md#useinitstorage)
- [usePerformance](sdk.md#useperformance)
- [useRemoteConfig](sdk.md#useremoteconfig)
+- [useStorage](sdk.md#usestorage)
-## Type aliases
-
-### PreloadOptions
-
-Ƭ **PreloadOptions**<`T`\>: `Object`
+## Functions
-#### Type parameters
+### AuthProvider
-| Name |
-| :------ |
-| `T` |
+▸ `Const` **AuthProvider**(`props`): `Element`
-#### Type declaration
+#### Parameters
| Name | Type |
| :------ | :------ |
-| `firebaseApp` | `App` |
-| `setup?` | (`instanceFactory`: `T`) => `void` \| `Promise`<`any`\> |
-| `suspense?` | `boolean` |
+| `props` | `PropsWithChildren`<`Object`\> |
-#### Defined in
-
-[src/sdk.tsx:100](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L100)
-
-## Variables
-
-### useAnalytics
+#### Returns
-• `Const` **useAnalytics**: typeof `analytics`
+`Element`
#### Defined in
-[src/sdk.tsx:91](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L91)
+[src/sdk.tsx:82](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L82)
___
-### useAuth
-
-• `Const` **useAuth**: typeof `auth`
+### DatabaseProvider
-#### Defined in
+▸ `Const` **DatabaseProvider**(`props`): `Element`
-[src/sdk.tsx:90](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L90)
+#### Parameters
-___
+| Name | Type |
+| :------ | :------ |
+| `props` | `PropsWithChildren`<`Object`\> |
-### useDatabase
+#### Returns
-• `Const` **useDatabase**: typeof `database`
+`Element`
#### Defined in
-[src/sdk.tsx:92](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L92)
+[src/sdk.tsx:83](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L83)
___
-### useFirestore
-
-• `Const` **useFirestore**: typeof `firestore`
+### FirestoreProvider
-#### Defined in
+▸ `Const` **FirestoreProvider**(`props`): `Element`
-[src/sdk.tsx:93](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L93)
+#### Parameters
-___
+| Name | Type |
+| :------ | :------ |
+| `props` | `PropsWithChildren`<`Object`\> |
-### useFunctions
+#### Returns
-• `Const` **useFunctions**: typeof `functions`
+`Element`
#### Defined in
-[src/sdk.tsx:94](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L94)
+[src/sdk.tsx:84](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L84)
___
-### useMessaging
+### PerformanceProvider
-• `Const` **useMessaging**: typeof `messaging`
+▸ `Const` **PerformanceProvider**(`props`): `Element`
-#### Defined in
-
-[src/sdk.tsx:95](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L95)
+#### Parameters
-___
+| Name | Type |
+| :------ | :------ |
+| `props` | `PropsWithChildren`<`Object`\> |
-### useStorage
+#### Returns
-• `Const` **useStorage**: typeof `storage`
+`Element`
#### Defined in
-[src/sdk.tsx:98](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L98)
+[src/sdk.tsx:85](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L85)
-## Functions
+___
-### preloadAnalytics
+### RemoteConfigProvider
-▸ `Const` **preloadAnalytics**(`options`): `Promise`<`fn`\>
+▸ `Const` **RemoteConfigProvider**(`props`): `Element`
#### Parameters
| Name | Type |
| :------ | :------ |
-| `options` | [`PreloadOptions`](sdk.md#preloadoptions)<`fn`\> |
+| `props` | `PropsWithChildren`<`Object`\> |
#### Returns
-`Promise`<`fn`\>
+`Element`
#### Defined in
-[src/sdk.tsx:144](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L144)
+[src/sdk.tsx:87](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L87)
___
-### preloadAuth
+### StorageProvider
-▸ `Const` **preloadAuth**(`options`): `Promise`<`fn`\>
+▸ `Const` **StorageProvider**(`props`): `Element`
#### Parameters
| Name | Type |
| :------ | :------ |
-| `options` | [`PreloadOptions`](sdk.md#preloadoptions)<`fn`\> |
+| `props` | `PropsWithChildren`<`Object`\> |
#### Returns
-`Promise`<`fn`\>
+`Element`
#### Defined in
-[src/sdk.tsx:143](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L143)
+[src/sdk.tsx:86](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L86)
___
-### preloadDatabase
+### useAuth
-▸ `Const` **preloadDatabase**(`options`): `Promise`<`fn`\>
+▸ `Const` **useAuth**(): `Auth`
-#### Parameters
+#### Returns
-| Name | Type |
-| :------ | :------ |
-| `options` | [`PreloadOptions`](sdk.md#preloadoptions)<`fn`\> |
+`Auth`
+
+#### Defined in
+
+[src/sdk.tsx:89](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L89)
+
+___
+
+### useDatabase
+
+▸ `Const` **useDatabase**(): `Database`
#### Returns
-`Promise`<`fn`\>
+`Database`
#### Defined in
-[src/sdk.tsx:145](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L145)
+[src/sdk.tsx:90](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L90)
___
-### preloadFirestore
+### useFirestore
+
+▸ `Const` **useFirestore**(): `Firestore`
+
+#### Returns
+
+`Firestore`
+
+#### Defined in
-▸ `Const` **preloadFirestore**(`options`): `Promise`<`fn`\>
+[src/sdk.tsx:91](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L91)
+
+___
+
+### useInitAuth
+
+▸ `Const` **useInitAuth**(`initializer`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`Auth`\>
#### Parameters
| Name | Type |
| :------ | :------ |
-| `options` | [`PreloadOptions`](sdk.md#preloadoptions)<`fn`\> |
+| `initializer` | (`firebaseApp`: `FirebaseApp`) => `Promise`<`Auth`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`Auth`\> |
#### Returns
-`Promise`<`fn`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`Auth`\>
#### Defined in
-[src/sdk.tsx:146](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L146)
+[src/sdk.tsx:101](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L101)
___
-### preloadFunctions
+### useInitDatabase
-▸ `Const` **preloadFunctions**(`options`): `Promise`<`fn`\>
+▸ `Const` **useInitDatabase**(`initializer`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`Database`\>
#### Parameters
| Name | Type |
| :------ | :------ |
-| `options` | [`PreloadOptions`](sdk.md#preloadoptions)<`fn`\> |
+| `initializer` | (`firebaseApp`: `FirebaseApp`) => `Promise`<`Database`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`Database`\> |
#### Returns
-`Promise`<`fn`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`Database`\>
#### Defined in
-[src/sdk.tsx:147](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L147)
+[src/sdk.tsx:102](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L102)
___
-### preloadMessaging
+### useInitFirestore
-▸ `Const` **preloadMessaging**(`options`): `Promise`<`fn`\>
+▸ `Const` **useInitFirestore**(`initializer`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`Firestore`\>
#### Parameters
| Name | Type |
| :------ | :------ |
-| `options` | [`PreloadOptions`](sdk.md#preloadoptions)<`fn`\> |
+| `initializer` | (`firebaseApp`: `FirebaseApp`) => `Promise`<`Firestore`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`Firestore`\> |
#### Returns
-`Promise`<`fn`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`Firestore`\>
#### Defined in
-[src/sdk.tsx:148](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L148)
+[src/sdk.tsx:103](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L103)
___
-### preloadPerformance
+### useInitPerformance
-▸ `Const` **preloadPerformance**(`options`): `Promise`<`fn`\>
+▸ `Const` **useInitPerformance**(`initializer`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`FirebasePerformance`\>
#### Parameters
| Name | Type |
| :------ | :------ |
-| `options` | [`PreloadOptions`](sdk.md#preloadoptions)<`fn`\> |
+| `initializer` | (`firebaseApp`: `FirebaseApp`) => `Promise`<`FirebasePerformance`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`FirebasePerformance`\> |
#### Returns
-`Promise`<`fn`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`FirebasePerformance`\>
#### Defined in
-[src/sdk.tsx:149](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L149)
+[src/sdk.tsx:104](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L104)
___
-### preloadRemoteConfig
+### useInitRemoteConfig
-▸ `Const` **preloadRemoteConfig**(`options`): `Promise`<`fn`\>
+▸ `Const` **useInitRemoteConfig**(`initializer`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`RemoteConfig`\>
#### Parameters
| Name | Type |
| :------ | :------ |
-| `options` | [`PreloadOptions`](sdk.md#preloadoptions)<`fn`\> |
+| `initializer` | (`firebaseApp`: `FirebaseApp`) => `Promise`<`RemoteConfig`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`RemoteConfig`\> |
#### Returns
-`Promise`<`fn`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`RemoteConfig`\>
#### Defined in
-[src/sdk.tsx:150](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L150)
+[src/sdk.tsx:106](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L106)
___
-### preloadStorage
+### useInitStorage
-▸ `Const` **preloadStorage**(`options`): `Promise`<`fn`\>
+▸ `Const` **useInitStorage**(`initializer`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`FirebaseStorage`\>
#### Parameters
| Name | Type |
| :------ | :------ |
-| `options` | [`PreloadOptions`](sdk.md#preloadoptions)<`fn`\> |
+| `initializer` | (`firebaseApp`: `FirebaseApp`) => `Promise`<`FirebaseStorage`\> |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`FirebaseStorage`\> |
#### Returns
-`Promise`<`fn`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`FirebaseStorage`\>
#### Defined in
-[src/sdk.tsx:151](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L151)
+[src/sdk.tsx:108](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L108)
___
### usePerformance
-▸ `Const` **usePerformance**(`app?`): `firebase.performance.Performance`
-
-#### Parameters
-
-| Name | Type |
-| :------ | :------ |
-| `app?` | `firebase.app.App` |
+▸ `Const` **usePerformance**(): `FirebasePerformance`
#### Returns
-`firebase.performance.Performance`
+`FirebasePerformance`
#### Defined in
-[src/sdk.tsx:96](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L96)
+[src/sdk.tsx:92](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L92)
___
### useRemoteConfig
-▸ `Const` **useRemoteConfig**(`app?`): `firebase.remoteConfig.RemoteConfig`
+▸ `Const` **useRemoteConfig**(): `RemoteConfig`
-#### Parameters
+#### Returns
-| Name | Type |
-| :------ | :------ |
-| `app?` | `firebase.app.App` |
+`RemoteConfig`
+
+#### Defined in
+
+[src/sdk.tsx:94](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L94)
+
+___
+
+### useStorage
+
+▸ `Const` **useStorage**(): `FirebaseStorage`
#### Returns
-`firebase.remoteConfig.RemoteConfig`
+`FirebaseStorage`
#### Defined in
-[src/sdk.tsx:97](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L97)
+[src/sdk.tsx:93](https://github.com/FirebaseExtended/reactfire/blob/main/src/sdk.tsx#L93)
diff --git a/docs/reference/modules/storage.md b/docs/reference/modules/storage.md
index c042f41d..a0c7aa1b 100644
--- a/docs/reference/modules/storage.md
+++ b/docs/reference/modules/storage.md
@@ -28,13 +28,13 @@
#### Defined in
-[src/storage.tsx:102](https://github.com/FirebaseExtended/reactfire/blob/main/src/storage.tsx#L102)
+[src/storage.tsx:100](https://github.com/FirebaseExtended/reactfire/blob/main/src/storage.tsx#L100)
___
### useStorageDownloadURL
-▸ **useStorageDownloadURL**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`string` \| `T`\>
+▸ **useStorageDownloadURL**<`T`\>(`ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`string` \| `T`\>
Subscribe to a storage ref's download URL
@@ -48,22 +48,22 @@ Subscribe to a storage ref's download URL
| Name | Type | Description |
| :------ | :------ | :------ |
-| `ref` | `firebase.storage.Reference` | reference to the blob you want to download |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`\> | |
+| `ref` | `StorageReference` | reference to the blob you want to download |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`\> | |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`string` \| `T`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`string` \| `T`\>
#### Defined in
-[src/storage.tsx:53](https://github.com/FirebaseExtended/reactfire/blob/main/src/storage.tsx#L53)
+[src/storage.tsx:51](https://github.com/FirebaseExtended/reactfire/blob/main/src/storage.tsx#L51)
___
### useStorageTask
-▸ **useStorageTask**<`T`\>(`task`, `ref`, `options?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.storage.UploadTaskSnapshot` \| `T`\>
+▸ **useStorageTask**<`T`\>(`task`, `ref`, `options?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`UploadTaskSnapshot` \| `T`\>
Subscribe to the progress of a storage task
@@ -77,14 +77,14 @@ Subscribe to the progress of a storage task
| Name | Type | Description |
| :------ | :------ | :------ |
-| `task` | `firebase.storage.UploadTask` | the task you want to listen to |
-| `ref` | `firebase.storage.Reference` | reference to the blob the task is acting on |
-| `options?` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md)<`T`\> | |
+| `task` | `UploadTask` | the task you want to listen to |
+| `ref` | `StorageReference` | reference to the blob the task is acting on |
+| `options?` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md)<`T`\> | |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`firebase.storage.UploadTaskSnapshot` \| `T`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`UploadTaskSnapshot` \| `T`\>
#### Defined in
-[src/storage.tsx:36](https://github.com/FirebaseExtended/reactfire/blob/main/src/storage.tsx#L36)
+[src/storage.tsx:38](https://github.com/FirebaseExtended/reactfire/blob/main/src/storage.tsx#L38)
diff --git a/docs/reference/modules/useobservable.md b/docs/reference/modules/useObservable.md
similarity index 61%
rename from docs/reference/modules/useobservable.md
rename to docs/reference/modules/useObservable.md
index c0d5c7c9..347491ab 100644
--- a/docs/reference/modules/useobservable.md
+++ b/docs/reference/modules/useObservable.md
@@ -6,18 +6,18 @@
### Interfaces
-- [ObservableStatus](../interfaces/useobservable.observablestatus.md)
+- [ObservableStatus](../interfaces/useObservable.ObservableStatus.md)
### Functions
-- [preloadObservable](useobservable.md#preloadobservable)
-- [useObservable](useobservable.md#useobservable)
+- [preloadObservable](useObservable.md#preloadobservable)
+- [useObservable](useObservable.md#useobservable)
## Functions
### preloadObservable
-▸ **preloadObservable**<`T`\>(`source`, `id`): [`SuspenseSubject`](../classes/suspensesubject.suspensesubject-1.md)<`T`\>
+▸ **preloadObservable**<`T`\>(`source`, `id`): [`SuspenseSubject`](../classes/SuspenseSubject.SuspenseSubject-1.md)<`T`\>
#### Type parameters
@@ -34,7 +34,7 @@
#### Returns
-[`SuspenseSubject`](../classes/suspensesubject.suspensesubject-1.md)<`T`\>
+[`SuspenseSubject`](../classes/SuspenseSubject.SuspenseSubject-1.md)<`T`\>
#### Defined in
@@ -44,25 +44,25 @@ ___
### useObservable
-▸ **useObservable**<`T`\>(`observableId`, `source`, `config?`): [`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`\>
+▸ **useObservable**<`T`\>(`observableId`, `source`, `config?`): [`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`\>
#### Type parameters
-| Name |
-| :------ |
-| `T` |
+| Name | Type |
+| :------ | :------ |
+| `T` | `unknown` |
#### Parameters
| Name | Type |
| :------ | :------ |
| `observableId` | `string` |
-| `source` | `Observable`<`T` \| `any`\> |
-| `config` | [`ReactFireOptions`](../interfaces/index.reactfireoptions.md) |
+| `source` | `Observable`<`T`\> |
+| `config` | [`ReactFireOptions`](../interfaces/index.ReactFireOptions.md) |
#### Returns
-[`ObservableStatus`](../interfaces/useobservable.observablestatus.md)<`T`\>
+[`ObservableStatus`](../interfaces/useObservable.ObservableStatus.md)<`T`\>
#### Defined in
diff --git a/docs/upgrade-guide.md b/docs/upgrade-guide.md
new file mode 100644
index 00000000..719ef52c
--- /dev/null
+++ b/docs/upgrade-guide.md
@@ -0,0 +1,25 @@
+# Upgrade from ReactFire v3 to v4
+
+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.
+
+1. Get the latest version of ReactFire and Firebase
+
+```
+npm i firebase@latest reactfire@latest
+
+# or
+
+yarn add firebase@latest reactfire@latest
+```
+
+2. Initialize product SDKs and register them with ReactFire
+
+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).
+
+If you need to connect to the Local Emulator Suite, [check out this code sample](./use.md#connect-to-the-firebase-local-emulator-suite).
+
+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.
+
+3. Update your Firebase code
+
+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).
diff --git a/docs/use.md b/docs/use.md
index 2ef90292..ece31f3d 100644
--- a/docs/use.md
+++ b/docs/use.md
@@ -1,25 +1,38 @@
# Using ReactFire
-> ⚠️ These examples currently rely use ReactFire's concurrent mode features. We'd love PRs that add samples that work with stable builds of React!
-
-- [Access your `firebase` app from any component](#access-your-firebase-app-from-any-component)
-- [Access the current user](#access-the-current-user)
- - [Decide what to render based on a user's auth state](#decide-what-to-render-based-on-a-users-auth-state)
-- [Log Page Views with React Router](#log-page-views-to-google-analytics-for-firebase-with-react-router)
-- [Combine Auth, Firestore, and Cloud Storage to Show a User Profile Card](#combine-auth-firestore-and-cloud-storage-to-show-a-user-profile-card)
-- [Manage Loading States](#manage-loading-states)
- - [Default: `Suspense`](#default-suspense)
- - [Bonus: `SuspenseWithPerf`](#bonus-suspensewithperf)
- - [Provide an initial value](#dont-want-suspense-provide-an-initial-value)
-- [Lazy Load the Firebase SDKs](#lazy-load-the-Firebase-SDKs)
-- [The _render-as-you-fetch_ pattern](#the-render-as-you-fetch-pattern)
- - [Preload an SDK](#preload-an-sdk)
- - [Preload Data](#preload-data)
+
+
+- [Setup](#setup)
+ * [Initialize product SDKs and register them with ReactFire](#initialize-product-sdks-and-register-them-with-reactfire)
+ * [Connect to the Firebase Local Emulator Suite](#connect-to-the-firebase-local-emulator-suite)
+- [Auth](#auth)
+ * [Display the current signed-in user](#display-the-current-signed-in-user)
+ * [Only render a component if a user is signed in](#only-render-a-component-if-a-user-is-signed-in)
+- [Cloud Firestore](#cloud-firestore)
+ * [Access data offline](#access-data-offline)
+ * [Show a single document](#show-a-single-document)
+ * [Show a list of data (collection)](#show-a-list-of-data-collection)
+- [Realtime Database](#realtime-database)
+ * [Show an object](#show-an-object)
+ * [Show a list of data](#show-a-list-of-data)
+- [Cloud Storage for Firebase](#cloud-storage-for-firebase)
+ * [Fetch and show an image](#fetch-and-show-an-image)
+ * [Show upload status](#show-upload-status)
+- [Remote Config](#remote-config)
+ * [Initialize, fetch, and activate](#initialize-fetch-and-activate)
+ * [Get a string](#get-a-string)
+- [Performance Monitoring](#performance-monitoring)
+ * [Load Performance Monitoring asynchronously](#load-performance-monitoring-asynchronously)
+- [Log Page Views to Google Analytics for Firebase with React Router](#log-page-views-to-google-analytics-for-firebase-with-react-router)
- [Advanced: Using RxJS observables to combine multiple data sources](#advanced-using-rxjs-observables-to-combine-multiple-data-sources)
-## Access your `firebase` app from any component
+
-Since ReactFire uses React's Context API, any component under a `FirebaseAppProvider` can use `useFirebaseApp()` to get your initialized app. Plus, all ReactFire hooks will automatically check context to see if a firebase app is available.
+---
+
+## Setup
+
+Since ReactFire uses React's Context API, any child of a `FirebaseAppProvider` can call `useFirebaseApp()` to get your initialized app. Plus, all ReactFire hooks will automatically check context to see if a firebase app is available.
```jsx
// ** INDEX.JS **
@@ -29,47 +42,113 @@ const firebaseConfig = {
render(
-
+
);
-// ** MYCOMPONENT.JS **
+// ** MyComponent.JS **
function MyComponent(props) {
// useFirestore will get the firebase app from Context!
- const documentReference = useFirestore()
- .collection('burritos')
- .doc('vegetarian');
+ const app = useFirebaseApp();
+}
+```
+
+### Initialize product SDKs and register them with ReactFire
+
+Just as `FirebaseAppProvider` allows child components to access the `FirebaseApp` instance, each Firebase product SDK (like `firebase/auth` or `firebase/database`) has a provider:
+
+```jsx
+import { getAuth } from 'firebase/auth'; // Firebase v9+
+import { getDatabase } from 'firebase/database'; // Firebase v9+
+
+import { FirebaseAppProvider, DatabaseProvider, AuthProvider, useFirebaseApp } from 'reactfire';
+
+function FirebaseComponents({ children }) {
+ const app = useFirebaseApp(); // a parent component contains a `FirebaseAppProvider`
- // ...
+ // initialize Database and Auth with the normal Firebase SDK functions
+ const database = getDatabase(app);
+ const auth = getAuth(app);
+
+ // any child components will be able to use `useUser`, `useDatabaseObjectData`, etc
+ return (
+
+
+
+
+
+ );
}
```
-## Access the current user
+Some products benefit from asynchronous initialization. For that, ReactFire has hooks like `useInitFirestore` and `useInitRemoteConfig`. Learn more about these in the individual product sections below.
-The `useUser()` hook returns the currently signed-in [user](https://firebase.google.com/docs/reference/js/firebase.User). Like the other ReactFire Hooks, you need to wrap it in `Suspense` or provide a `initialData`.
+### Connect to the Firebase Local Emulator Suite
+
+Connect a product SDK to the emulator before passing it to a provider. For example, to connect to the Auth and Realtime Database emulators:
```jsx
-function HomePage(props) {
- // no need to use useFirebaseApp - useUser calls it under the hood
- const { data: user } = useUser();
+import { getAuth, connectAuthEmulator } from 'firebase/auth'; // Firebase v9+
+import { getDatabase, connectDatabaseEmulator } from 'firebase/database'; // Firebase v9+
+
+import { FirebaseAppProvider, DatabaseProvider, AuthProvider, useFirebaseApp } from 'reactfire';
+
+function FirebaseComponents({ children }) {
+ const app = useFirebaseApp();
+ const database = getDatabase(app);
+ const auth = getAuth(app);
+
+ // Check for dev/test mode however your app tracks that.
+ // `process.env.NODE_ENV` is a common React pattern
+ if (process.env.NODE_ENV !== 'production') {
+ // Set up emulators
+ connectDatabaseEmulator(database, 'localhost', 9000);
+ connectAuthEmulator(auth, 'http://localhost:9099');
+ }
- return
Welcome Back {user.displayName}!
;
+ return (
+
+
+
+
+
+ );
}
```
-Note: `useUser` will also automatically lazily import the `firebase/auth` SDK if it has not been imported already.
+Learn more about the Local Emulator Suite in the [Firebase docs](https://firebase.google.com/docs/emulator-suite/connect_and_prototype).
+
+## Auth
-### Decide what to render based on a user's auth state
+The following samples assume that `FirebaseAppProvider` and `AuthProvider` components exist higher up the component tree.
-The `useSigninCheck` hook makes it easy to decide whether to hide or show UI elements based on a user's auth state, and even their [custom claims](https://firebase.google.com/docs/auth/admin/custom-claims). It will render its children if a user is signed in, but if they are not signed in, it renders its `fallback` prop:
+### Display the current signed-in user
+
+The `useUser()` hook returns the currently signed-in [user](https://firebase.google.com/docs/reference/js/v9/auth.user).
+
+```jsx
+function HomePage(props) {
+ const { status, data: user } = useUser();
+
+ if (status === 'loading') {
+ return loading...;
+ }
+
+ return
Welcome Back, {user.displayName}!
;
+}
+```
+
+### Only render a component if a user is signed in
+
+The `useSigninCheck` hook makes it easy to decide whether to hide or show UI elements based on a user's auth state, and can even check their [custom claims](https://firebase.google.com/docs/auth/admin/custom-claims). It will render its children if a user is signed in, but if they are not signed in, it renders its `fallback` prop:
```jsx
function UserFavorites() {
const { status, data: signInCheckResult } = useSigninCheck();
if (status === 'loading') {
- return ;
+ return loading...;
}
if (signInCheckResult.signedIn === true) {
@@ -80,247 +159,281 @@ function UserFavorites() {
}
```
-## Log Page Views to Google Analytics for Firebase with React Router
+## Cloud Firestore
-```jsx
-import { useAnalytics } from 'reactfire';
-import { Router, Route, Switch } from 'react-router';
+The following samples assume that `FirebaseAppProvider` and `FirestoreProvider` components exist higher up the component tree.
-function MyPageViewLogger({ location }) {
- const analytics = useAnalytics();
+### Access data offline
- // By passing `location.pathname` to the second argument of `useEffect`,
- // we only log on first render and when the `pathname` changes
- useEffect(() => {
- analytics.logEvent('page-view', { path_name: location.pathname });
- }, [location.pathname]);
+Cloud Firestore [supports offline data persistence](https://firebase.google.com/docs/firestore/manage-data/enable-offline#web-v9). However, it can be a bit tricky to enable, because you must call `enableIndexedDbPersistence` _before any other Firestore functions_. ReactFire's `useInitFirestore` makes this easy to handle:
- return null;
-}
+```jsx
+import { initializeFirestore, enableIndexedDbPersistence } from 'firebase/firestore';
+import { useInitFirestore, FirestoreProvider } from 'reactfire';
function App() {
- const analytics = useAnalytics();
+ const { status, data: firestoreInstance } = useInitFirestore(async (firebaseApp) => {
+ const db = initializeFirestore(firebaseApp, {});
+ await enableIndexedDbPersistence(db);
+ return db;
+ });
+ // firestore init isn't complete yet
+ if (status === 'loading') {
+ return ;
+ }
+
+ // pass the Firestore instance to FirestoreProvider
+ // now we can be sure that any child of FirestoreProvider
+ // has a fully initialized Firestore instance with
+ // indexedDbPersistence enabled
return (
-
-
- } />
- } />
-
-
-
+
+
+
+
);
}
```
-## Combine Auth, Firestore, and Cloud Storage to Show a User Profile Card
+### Show a single document
+
+This example subscribes to the `count/counter` document, and re-renders whenever the document updates.
```jsx
-import {
- AuthCheck,
- StorageImage,
- useFirestoreDocData,
- useUser,
- useAuth,
- useFirestore
-} from 'reactfire';
-
-const DEFAULT_IMAGE_PATH = 'userPhotos/default.jpg';
-
-function ProfileCard() {
- // get the current user.
- // this is safe because we've wrapped this component in an `AuthCheck` component.
- const { data: user } = useUser();
-
- // read the user details from Firestore based on the current user's ID
- const userDetailsRef = useFirestore()
- .collection('users')
- .doc(user.uid);
-
- let { commonName, favoriteAnimal, profileImagePath } = useFirestoreDocData(
- userDetailsRef
- );
+function Counter() {
+ const firestore = useFirestore();
+ const ref = doc(firestore, 'count', 'counter');
- // defend against null field(s)
- profileImagePath = profileImagePath || DEFAULT_IMAGE_PATH;
+ const { status, data: count } = useFirestoreDocData(ref);
- if (!commonName || !favoriteAnimal) {
- throw new Error(MissingProfileInfoError);
+ if (status === 'loading') {
+ return loading...;
}
- return (
-
-
{commonName}
- {/*
- `StorageImage` converts a Cloud Storage path into a download URL and then renders an image
- */}
-
- Your favorite animal is the {favoriteAnimal}
-
- );
+ return {count.value} ;
}
+```
-function LogInForm() {
- const auth = useAuth();
+### Show a list of data (collection)
- const signIn = () => {
- auth.signInWithEmailAndPassword(email, password);
- };
+This example queries the `animals` collection, sorts by `commonName`, and re-renders whenever the collection updates.
- return ;
-}
+```jsx
+function FavoriteAnimals() {
+ // set up query
+ const firestore = useFirestore();
+ const animalsCollection = collection(firestore, 'animals');
+ const animalsQuery = query(animalsCollection, orderBy('commonName', 'asc'));
+
+ // ReactFire!
+ const { status, data: animals } = useFirestoreCollectionData(animalsQuery, {
+ idField: 'id', // this field will be added to the object created from each document
+ });
+
+ if (status === 'loading') {
+ return loading...;
+ }
-function ProfilePage() {
return (
- {/*
- Render a spinner until components are ready
- */}
- }>
- {/*
- Render `ProfileCard` only if a user is signed in.
- Otherwise, render `LoginForm`
- */}
- }>{ProfileCard}
-
+
+ {animals.map((animal) => (
+
{animal.commonName}
+ ))}
+
);
}
```
-## Manage Loading States
-
-ReactFire is designed to integrate with React's Suspense API, but also supports use cases where Suspense isn't needed or wanted.
+## Realtime Database
-### Default: `Suspense`
+The following samples assume that `FirebaseAppProvider` and `RealtimeDatabaseProvider` components exist higher up the component tree.
-Say we have a component called `Burrito` that uses `useFirestoreDoc`:
+### Show an object
```jsx
-function Burrito() {
- const burritoRef = useFirestore()
- .collection('tryreactfire')
- .doc('burrito');
+function Counter() {
+ const database = useDatabase();
+ const counterRef = ref(database, 'counter');
- // subscribe to the doc. just one line!
- // throws a Promise for Suspense to catch,
- // and then streams live updates
- const burritoDoc = useFirestoreDoc(burritoRef);
+ const { status, data: count } = useDatabaseObjectData(counterRef);
- const isYummy = burritoDoc.data().yummy;
+ if (status === 'loading') {
+ return loading...;
+ }
- return
The burrito is {isYummy ? 'good' : 'bad'}!
;
+ return {count} ;
}
```
-The parent component of `Burrito` can use `Suspense` to render a `fallback` component until `useFirestoreDoc` returns a value:
+### Show a list of data
```jsx
-function FoodRatings() {
- return (
-
-
-
- );
-}
-```
+function AnimalsList() {
+ const database = useDatabase();
+ const animalsRef = ref(database, 'animals');
+ const animalsQuery = query(animalsRef, orderByChild('commonName'));
-#### Bonus: `SuspenseWithPerf`
+ const { status, data: animals } = useDatabaseListData(animalsQuery, {
+ idField: 'id',
+ });
-ReactFire provides an a wrapper around `Suspense` called `SuspenseWithPerf` that instruments your `Suspense` loads with a Firebase Performance Monitoring custom trace. It looks like this:
+ if (status === 'loading') {
+ return loading...;
+ }
-```jsx
-function FoodRatings() {
return (
-
-
-
+
+ {animals.map((animal) => (
+
{animal.commonName}
+ ))}
+
);
}
```
-### Don't want Suspense? Provide an initial value
+## Cloud Storage for Firebase
+
+The following samples assume that `FirebaseAppProvider` and `StorageProvider` components exist higher up the component tree.
-What if we don't want to use Suspense, or we're server rendering and we know what the initial value should be? In that case we can provide an initial value to any ReactFire hook:
+### Fetch and show an image
```jsx
-function Burrito() {
- const firebaseApp = useFirebaseApp();
- const burritoRef = firebaseApp
- .firestore()
- .collection('tryreactfire')
- .doc('burrito');
-
- // subscribe to the doc. just one line!
- // returns the `initialData`,
- // and then streams live updates
- const burritoDoc = useFirestoreDocData(burritoRef, {
- initialData: {
- yummy: true
- }
- });
+function CatImage() {
+ const storage = useStorage();
+ const catRef = ref(storage, 'cats/newspaper');
- const isYummy = burritoDoc.data().yummy;
+ const { status, data: imageURL } = useStorageDownloadURL(ref(storage, storagePath));
- return
The burrito is {isYummy ? 'good' : 'bad'}!
;
+ if (status === 'loading') {
+ return loading...;
+ }
+
+ return ;
}
```
-The parent component of `Burrito` now doesn't need to use `Suspense`:
+### Show upload status
```jsx
-function FoodRatings() {
- return ;
-}
-```
+function UploadProgress({ uploadTask, storageRef }) {
+ const { status, data: uploadProgress } = useStorageTask < UploadTaskSnapshot > (uploadTask, storageRef);
-### Solve `Warning: App triggered a user-blocking update that suspended.` with useTransition
+ let percentComplete;
-This warning can be solved with React's `useTransition` hook. Check out the sample code's Firestore example to see how to use this with ReactFire:
+ if (status === 'loading') {
+ percentComplete = '0%';
+ } else {
+ const { bytesTransferred, totalBytes } = uploadProgress;
+ percentComplete = Math.round(100 * (bytesTransferred / totalBytes)) + '%';
+ }
-https://github.com/FirebaseExtended/reactfire/blob/c67dfa755431c15034f0c713b9df3864fb762c06/sample/src/Firestore.js#L87-L121
+ return {percentComplete} uploaded;
+}
+```
-## Lazy Load the Firebase SDKs
+## Remote Config
-Including the Firebase SDKs in your main JS bundle (by using `import 'firebase/firestore'`, for example) will increase your bundle size. To get around this, you can lazy load the Firebase SDK with ReactFire. As long as a component has a parent that is a `FirebaseAppProvider`, you can use an SDK hook (`useFirestore`, `useDatabase`, `useAuth`, `useStorage`) like so:
+The following samples assume that `FirebaseAppProvider` and `RemoteConfigProvider` components exist higher up the component tree.
-`MyComponent.jsx`
+### Initialize, fetch, and activate
+
+ReactFire's `useInitRemoteConfig` hook makes it easy to set up Remote Config:
```jsx
-import React from 'react';
-// WE ARE NOT IMPORTING THE FIRESTORE SDK UP HERE
-import { useFirestoreDocData, useFirestore } from 'reactfire';
+import { getRemoteConfig, fetchAndActivate } from 'firebase/remote-config';
+import { useInitRemoteConfig, RemoteConfigProvider } from 'reactfire';
-export function MyComponent(props) {
- // automatically lazy loads the Cloud Firestore SDK
- const firestore = useFirestore();
+function App() {
+ const { status, data: remoteConfigInstance } = useInitRemoteConfig(async (firebaseApp) => {
+ const remoteConfig = getRemoteConfig(firebaseApp);
+ remoteConfig.settings = {
+ minimumFetchIntervalMillis: 10000,
+ fetchTimeoutMillis: 10000,
+ };
+
+ await fetchAndActivate(remoteConfig);
+ return remoteConfig;
+ });
- const ref = firestore().doc('count/counter');
- const data = useFirestoreDocData(ref);
+ if (status === 'loading') {
+ return initializing Remote Config...;
+ }
- return
{data.value}
;
+ // Child components of RemoteConfigProvider can be confident that Remote Config is
+ // fully initialized
+ return (
+
+
+
+ );
}
```
-## The _render-as-you-fetch_ pattern
+### Get a string
-The [React docs](https://reactjs.org/docs/concurrent-mode-suspense.html#approach-3-render-as-you-fetch-using-suspense) recommend kicking off reads as early as possible in order to reduce perceived load times. ReactFire offers a number of `preload` methods to help you do this.
+```jsx
+function WelcomeMessage() {
+ const { status, data: messageValue } = useRemoteConfigString('welcome-experiment');
-### Preload an SDK
+ if (status === 'loading') {
+ return loading...;
+ }
-Call `preloadFirestore` (or `preloadAuth`, `preloadRemoteConfig`, etc) to start fetching a Firebase library in the background. Later, when you call `useFirestore` in a component, the `useFirestore` hook may not need to suspend if the preload has already completed.
+ return {messageValue};
+}
+```
-### Initialize an SDK
+## Performance Monitoring
-Some Firestore SDKs need to be initialized (`firebase.remoteConfig().fetchAndActivate()`), or need to have settings set before any other calls are made (`firebase.firestore().enablePersistence()`). This can be done by passing a function returning a promise to the `setup` option.
+### Load Performance Monitoring asynchronously
+
+You can import the `firebase/performance` library asynchronously to make sure it doesn't affect your page load times:
```jsx
-preloadFirestore({
- setup: firestore => firestore().enablePersistence()
-});
+import { useInitPerformance } from 'ReactFire';
+function App() {
+ useInitPerformance(async (firebaseApp) => {
+ const { getPerformance } = await import('firebase/performance');
+ return getPerformance(firebaseApp);
+ });
+
+ //...
+}
```
-### Preload Data
+## Log Page Views to Google Analytics for Firebase with React Router
+
+```jsx
+import { useAnalytics } from 'reactfire';
+import { Router, Route, Switch } from 'react-router';
+
+function MyPageViewLogger({ location }) {
+ const analytics = useAnalytics();
+
+ // By passing `location.pathname` to the second argument of `useEffect`,
+ // we only log on first render and when the `pathname` changes
+ useEffect(() => {
+ analytics.logEvent('page-view', { path_name: location.pathname });
+ }, [location.pathname]);
+
+ return null;
+}
-ReactFire's data fetching hooks don't fully support preloading yet. The experimental `preloadFirestoreDoc` function allows you to subscribe to a Firestore document if you know you call `useFirestoreDoc` somewhere farther down the component tree.
+function App() {
+ const analytics = useAnalytics();
+
+ return (
+
+
+ } />
+ } />
+
+
+
+ );
+}
+```
## Advanced: Using RxJS observables to combine multiple data sources
diff --git a/example/index.tsx b/example/index.tsx
index 6b08d78a..e2f714a7 100644
--- a/example/index.tsx
+++ b/example/index.tsx
@@ -7,9 +7,12 @@ import * as ReactDOM from 'react-dom';
* You'll need to use an experimental build of React to use Concurrent mode
* https://reactjs.org/docs/concurrent-mode-adoption.html#installation
*/
-// import { AppWrapper as ConcurrentModeApp } from './withSuspense/App';
+// import {} from 'react/experimental' // make TS aware of experimental features
+// import {} from 'react-dom/experimental' // make TS aware of experimental features
+// import { App as ConcurrentModeApp } from './withSuspense/App';
import { App as NonConcurrentModeApp } from './withoutSuspense/App';
import './styles.pcss';
+import { FirebaseAppProvider } from 'reactfire';
const firebaseConfig = {
apiKey: 'AIzaSyBg3u1sJlyJwQCE95oSDH_mtLABS-is8ZM',
@@ -18,7 +21,7 @@ const firebaseConfig = {
projectId: 'rxfire-525a3',
storageBucket: 'rxfire-525a3.appspot.com',
messagingSenderId: '844180061847',
- appId: '1:844180061847:web:400f7142e2d1aaeb'
+ appId: '1:844180061847:web:400f7142e2d1aaeb',
};
const rootElement = document.getElementById('root');
@@ -26,5 +29,18 @@ if (!rootElement) {
throw new Error('Could not find root element');
}
-ReactDOM.render(, rootElement);
+ReactDOM.render(
+
+
+ ,
+ rootElement
+);
+/**
+ * FOR CONCURRENT MODE
+ */
+// ReactDOM.createRoot(rootElement).render(
+//
+//
+//
+// );
diff --git a/example/package.json b/example/package.json
index 14a36eb1..1e124223 100644
--- a/example/package.json
+++ b/example/package.json
@@ -4,27 +4,26 @@
"main": "index.js",
"license": "MIT",
"scripts": {
- "start": "parcel --no-cache index.html",
+ "start": "parcel ./index.html --no-cache",
"build": "parcel build index.html"
},
"dependencies": {
- "display": "^0.1.9",
- "react-app-polyfill": "^1.0.0",
- "react-firebaseui": "^4.2.0",
"tailwindcss": "^1.9.1"
},
+ "browserslist": [
+ "last 1 Chrome version"
+ ],
"alias": {
+ "firebase": "../node_modules/firebase",
"react": "../node_modules/react",
"react-dom": "../node_modules/react-dom",
"reactfire": "../."
},
"devDependencies": {
"@babel/core": "^7.11.6",
- "@types/react": "^16.9.11",
- "@types/react-dom": "^16.8.4",
"babel-preset-env": "^1.7.0",
- "parcel-bundler": "1.12.5",
+ "parcel-bundler": "^1.12.5",
"postcss": "^8.3.5",
- "typescript": "^3.4.5"
+ "typescript": "^4.2.4"
}
}
diff --git a/example/tsconfig.json b/example/tsconfig.json
index 370b7172..3c9f2fb9 100644
--- a/example/tsconfig.json
+++ b/example/tsconfig.json
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": false,
- "target": "es5",
- "module": "commonjs",
+ "target": "ES2017",
+ "module": "ESNext",
"jsx": "react",
"moduleResolution": "node",
"noImplicitAny": false,
@@ -18,9 +18,7 @@
"paths": {
"react": ["../node_modules/react"],
"react-dom": ["../node_modules/react-dom/profiling"],
- "react/experimental": ["../node_modules/react"],
- "scheduler/tracing": ["../node_modules/scheduler/tracing-profiling"],
- "reactfire": ["../."]
+ "reactfire": ["../."],
}
}
}
diff --git a/example/withSuspense/App.tsx b/example/withSuspense/App.tsx
index 89bad0f2..86ccf62d 100644
--- a/example/withSuspense/App.tsx
+++ b/example/withSuspense/App.tsx
@@ -1,100 +1,47 @@
import * as React from 'react';
-import {
- FirebaseAppProvider,
- preloadAuth,
- preloadDatabase,
- preloadFirestore,
- preloadFirestoreDoc,
- preloadRemoteConfig,
- preloadStorage,
- preloadUser,
- useFirebaseApp
-} from 'reactfire';
+import { AuthProvider, useFirebaseApp, useInitPerformance } from 'reactfire';
import { Card } from '../display/Card';
import { Auth } from './Auth';
import { Firestore } from './Firestore';
import { RealtimeDatabase } from './RealtimeDatabase';
import { RemoteConfig } from './RemoteConfig';
+import { Storage } from './Storage';
// Import auth directly because most components need it
// Other Firebase libraries can be lazy-loaded as-needed
-import 'firebase/auth';
-import { Storage } from './Storage';
-
-const preloadSDKs = firebaseApp => {
- return Promise.all([
- preloadFirestore({
- firebaseApp,
- setup(firestore) {
- return firestore().enablePersistence();
- }
- }),
- preloadDatabase({ firebaseApp }),
- preloadStorage({
- firebaseApp,
- setup(storage) {
- return storage().setMaxUploadRetryTime(10000);
- }
- }),
- preloadAuth({ firebaseApp }),
- preloadRemoteConfig({
- firebaseApp,
- setup(remoteConfig) {
- remoteConfig().settings = {
- minimumFetchIntervalMillis: 10000,
- fetchTimeoutMillis: 10000
- };
- return remoteConfig().fetchAndActivate();
- }
- })
- ]);
-};
+import { getAuth } from 'firebase/auth';
-const preloadData = async firebaseApp => {
- const user = await preloadUser({ firebaseApp });
-
- if (user) {
- await preloadFirestoreDoc(firestore => firestore.doc('count/counter'), firebaseApp);
- }
-};
+export const App = () => {
+ const firebaseApp = useFirebaseApp();
+ const auth = getAuth(firebaseApp);
+
+ useInitPerformance(
+ async (firebaseApp) => {
+ const { getPerformance } = await import('firebase/performance');
+ return getPerformance(firebaseApp);
+ },
+ { suspense: false } // false because we don't want to stop render while we wait for perf
+ );
-export const AppWrapper = ({ firebaseConfig }: { firebaseConfig: { [key: string]: unknown } }) => {
return (
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
};
-
-const App = () => {
- const firebaseApp = useFirebaseApp();
-
- // Kick off fetches for SDKs and data that
- // we know our components will eventually need.
- //
- // This is OPTIONAL but encouraged as part of the render-as-you-fetch pattern
- // https://reactjs.org/docs/concurrent-mode-suspense.html#approach-3-render-as-you-fetch-using-suspense
- preloadSDKs(firebaseApp).then(() => preloadData(firebaseApp));
-
- return (
- <>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
- );
-};
diff --git a/example/withSuspense/Auth.tsx b/example/withSuspense/Auth.tsx
index 3a9dce38..c02917f1 100644
--- a/example/withSuspense/Auth.tsx
+++ b/example/withSuspense/Auth.tsx
@@ -1,28 +1,43 @@
import * as React from 'react';
-import StyledFirebaseAuth from 'react-firebaseui/StyledFirebaseAuth';
-import { useAuth, useUser, SuspenseWithPerf, AuthCheck } from 'reactfire';
+import { useAuth, useUser, SuspenseWithPerf, useSigninCheck } from 'reactfire';
import { WideButton } from '../display/Button';
import { CardSection } from '../display/Card';
import { LoadingSpinner } from '../display/LoadingSpinner';
+import { GoogleAuthProvider, signInWithPopup, User } from "firebase/auth";
const signOut = auth => auth.signOut().then(() => console.log('signed out'));
+const signIn = async auth => {
+ const provider = new GoogleAuthProvider();
+
+ await signInWithPopup(auth, provider);
+}
+
+export const AuthWrapper = ({ children, fallback }: React.PropsWithChildren<{ fallback: JSX.Element }>): JSX.Element => {
+ const { data: signInCheckResult } = useSigninCheck();
+
+ if (!children) {
+ throw new Error('Children must be provided');
+ }
+
+ if (signInCheckResult.signedIn === true) {
+ return children as JSX.Element;
+ } else {
+ return fallback;
+ }
+};
const UserDetails = () => {
const auth = useAuth();
- const { data: user } = useUser();
+ const {data: user} = useUser();
return (
<>
- {user.displayName}
+ {(user as User).displayName}
- {user.providerData.map(profile => {
- if (profile) {
- return