From 3411540707b9de1e2e2d6e9d96e14f291b23d986 Mon Sep 17 00:00:00 2001 From: Alwin Lohrie <46248939+niwla23@users.noreply.github.com> Date: Tue, 19 Jul 2022 20:16:47 +0200 Subject: [PATCH 1/3] Add warning about non-serializable datatypes in useState --- docs/content/2.guide/2.features/6.state-management.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/content/2.guide/2.features/6.state-management.md b/docs/content/2.guide/2.features/6.state-management.md index 727064711ce..f6ea5b09e2b 100644 --- a/docs/content/2.guide/2.features/6.state-management.md +++ b/docs/content/2.guide/2.features/6.state-management.md @@ -13,6 +13,9 @@ Nuxt provides `useState` composable to create a reactive and SSR-friendly shared ## Best practices +::alert{type=warning} +Note that data inside `useState` must be serializable. This means you can't use functions or classes in `useState`. +:: ::alert{type=danger icon=🚨} Never define `const state = ref()` outside of `