Skip to content

Commit

Permalink
Document bound mutate
Browse files Browse the repository at this point in the history
Refs #245
  • Loading branch information
akx committed Mar 30, 2020
1 parent c66bb82 commit 1b71be3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ try {
}
```

### Bound `mutate()`

The SWR object returned by `useSWR` also contains a `mutate()` function that is pre-bound to the SWR's key.

It is functionally equivalent to the global `mutate` function but does not require the `key` parameter.

### SSR with Next.js

With the `initialData` option, you pass an initial value to the hook. It works perfectly with many SSR solutions
Expand Down

0 comments on commit 1b71be3

Please sign in to comment.