I am following the example for useActionState
found here. I am using nextjs
When I run the example, I get:
Error: (0 , react__WEBPACK_IMPORTED_MODULE_1__.useActionState) is not a function or its return value is not iterable
My package.json looks like:
{
"name": "my-project",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"db:migrate": "TS_NODE_COMPILER_OPTIONS='{ "module": "commonjs" }' knex migrate:latest",
"db:migrate:undo": "TS_NODE_COMPILER_OPTIONS='{ "module": "commonjs" }' knex migrate:down",
"db:migrate:make": "TS_NODE_COMPILER_OPTIONS='{ "module": "commonjs" }' knex migrate:make"
},
"dependencies": {
"@prisma/client": "^5.13.0",
"antd": "^5.16.1",
"classnames": "2.3.1",
"dotenv": "^16.4.5",
"faker": "^6.6.6",
"knex": "^3.1.0",
"next": "14.1.4",
"pg": "^8.11.5",
"react": "canary",
"react-dom": "canary",
"react-scripts": "^5.0.0"
},
"devDependencies": {
"@faker-js/faker": "^8.4.1",
"@types/node": "20.12.2",
"@types/react": "18.3.1",
"@types/react-dom": "^18",
"autoprefixer": "^10.4.19",
"eslint": "^8",
"eslint-config-next": "14.1.4",
"postcss": "^8.4.38",
"prisma": "^5.13.0",
"tailwindcss": "^3.4.3",
"typescript": "4.9.5"
}
}