2022-03-30 15:59:28 +00:00
|
|
|
---
|
2022-10-06 09:15:30 +00:00
|
|
|
title: "useState"
|
|
|
|
description: "useState is an SSR-friendly ref replacement."
|
|
|
|
toc: false
|
2022-03-30 15:59:28 +00:00
|
|
|
---
|
|
|
|
|
2022-10-06 09:15:30 +00:00
|
|
|
Its value will be preserved after server-side rendering and shared across all components using a unique key.
|
2022-03-30 15:59:28 +00:00
|
|
|
|
|
|
|
::alert{type=info icon=👉}
|
2022-04-06 05:56:08 +00:00
|
|
|
Learn more about [useState](/api/composables/use-state).
|
|
|
|
::
|
|
|
|
|
|
|
|
::ReadMore{link="/api/composables/use-state"}
|
|
|
|
::
|
|
|
|
|
2022-09-13 12:54:31 +00:00
|
|
|
::ReadMore{link="/getting-started/state-management"}
|
2022-03-30 15:59:28 +00:00
|
|
|
::
|
|
|
|
|
|
|
|
::sandbox{repo="nuxt/framework" branch="main" dir="examples/composables/use-state" file="app.vue"}
|
2022-10-06 09:15:30 +00:00
|
|
|
::
|