2023-10-18 10:59:43 +00:00
---
title: 'clearNuxtState'
description: Delete the cached state of useState.
links:
- label: Source
icon: i-simple-icons-github
to: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/state.ts
size: xs
---
2023-06-09 21:22:21 +00:00
2024-02-21 17:09:45 +00:00
::note
2023-06-09 21:22:21 +00:00
This method is useful if you want to invalidate the state of `useState` .
2023-10-18 10:59:43 +00:00
::
2023-06-09 21:22:21 +00:00
## Type
```ts
clearNuxtState (keys?: string | string[] | ((key: string) => boolean)): void
```
## Parameters
2023-10-18 10:59:43 +00:00
- `keys` : One or an array of keys that are used in [`useState` ](/docs/api/composables/use-state ) to delete their cached state. If no keys are provided, **all state** will be invalidated.