Skip to content

Commit

Permalink
docs: add a warning for chaning the suspense option in the lifecycle (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 authored Jan 19, 2021
1 parent c09bd23 commit de287dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pages/docs/suspense.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ function App () {
}
```

<Callout>
Note that the `suspense` option is not allowed to change in the lifecycle.
</Callout>

In Suspense mode, `data` is always the fetch response (so you don't need to check if it's `undefined`).
But if an error occurred, you need to use an [error boundary](https://reactjs.org/docs/concurrent-mode-suspense.html#handling-errors) to catch it:

Expand Down

1 comment on commit de287dd

@vercel
Copy link

@vercel vercel bot commented on de287dd Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.