---
title: "NUXT_E7009"
description: "useState 键必须是字符串。"
canonical_url: "https://nuxt.zhcndoc.com/docs/4.x/errors/e7009"
---
# E7009

`useState()` 调用时传入的 key 不是字符串。该 key 用于标识整个应用以及 hydration payload 中的共享状态，因此它必须是一个非空字符串。

## 分辨率

```ts
const counter = useState('counter', () => 0)
```

::read-more{to="https://nuxt.zhcndoc.com/docs/4.x/api/composables/use-state"}
::


## Sitemap

See the full [sitemap](https://nuxt.zhcndoc.com/sitemap.md) for all pages.
