From def6ae99007274362708e60150e161fe265bc8af Mon Sep 17 00:00:00 2001 From: Jamie Warburton Date: Thu, 4 May 2023 08:33:25 +0100 Subject: [PATCH] feat: Update use-cookie.md to note that multiple invocations are not synced --- docs/3.api/1.composables/use-cookie.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/3.api/1.composables/use-cookie.md b/docs/3.api/1.composables/use-cookie.md index f36e466f0abb..deea5b7308a7 100644 --- a/docs/3.api/1.composables/use-cookie.md +++ b/docs/3.api/1.composables/use-cookie.md @@ -18,6 +18,10 @@ const cookie = useCookie(name, options) `useCookie` ref will automatically serialize and deserialize cookie value to JSON. :: +::alert{icon=⚠️} +Multiple invocations of `useCookie` with the same name are not synced. [You can utilise `useState()` to sync them as a workaround](https://github.com/nuxt/nuxt/issues/13020#issuecomment-1505548242). +:: + ## Example The example below creates a cookie called `counter`. If the cookie doesn't exist, it is initially set to a random value. Whenever we update the `counter` variable, the cookie will be updated accordingly.