Skip to content

Commit

Permalink
docs: ssrKey notes
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Dec 19, 2022
1 parent 1d46371 commit 5ecbae0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/guide/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,24 @@ const { data: users } = useUserList()
```
-->

## Manual SSR keys

VueFire automatically infers an SSR key based on the path of the document or collection whenever possible. This means there are some scenarios where **you have to provide a manual `ssrKey`**:

- When using Firestore Queries
- When binding the same document multiple times

In these scenarios, provide the `ssrKey` as a second argument to `useDocument()`, `useCollection()`, etc:

<FirebaseExample>

```ts
useDatabaseList(queryRef, { ssrKey: 'my-quiz' })
```

```ts
useCollection(queryRef, { ssrKey: 'my-quiz' })
```

</FirebaseExample>

0 comments on commit 5ecbae0

Please sign in to comment.