Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

docs: Add warning about non-serializable datatypes in useState #6003

Merged
merged 4 commits into from
Jul 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/content/2.guide/2.features/6.state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Nuxt provides `useState` composable to create a reactive and SSR-friendly shared
::alert{icon=πŸ‘‰}
`useState` only works during `setup` or [`Lifecycle Hooks`](https://vuejs.org/api/composition-api-lifecycle.html#composition-api-lifecycle-hooks).
::
::alert{type=warning}
Note that data inside `useState` must be serializable. This means you can't use functions or classes in `useState`.
::

## Best practices

Expand Down