Nuxt/docs/content/3.api/1.composables/use-state.md
Clément Ollivier 9a0fc57724
docs: update sitemap (#4063)
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
2022-04-06 07:56:08 +02:00

13 lines
370 B
Markdown

# `useState`
```ts
useState<T>(key: string, init?: () => T): Ref<T>
```
* **key**: A unique key ensuring that data fetching can be properly de-duplicated across requests
* **init**: A function that provides initial value for the state when it's not initiated
* **T**: (typescript only) Specify the type of state
::ReadMore{link="/guide/features/state-management"}
::