Nuxt 3 reached end of life on 31 July 2026
It no longer receives bug fixes or security patches. Upgrade to Nuxt 4 or get extended support from HeroDevs

clearNuxtState

Source
Delete the cached state of useState.
This method is useful if you want to invalidate the state of useState.

Type

Signature
export function clearNuxtState (keys?: string | string[] | ((key: string) => boolean)): void

Parameters

  • keys: One or an array of keys that are used in useState to delete their cached state. If no keys are provided, all state will be invalidated.