vercel / next-learn

Learn Next.js Starter Code
https://next-learn-dashboard.vercel.sh/
MIT License
3.39k stars 1.79k forks source link

Chapter 14: TS error when import 'useActionState' from React. #758

Closed estefrare closed 1 week ago

estefrare commented 1 week ago

There is a Typescript error when importing 'useActionState' from 'react', used in server-side-validation section.

import { useActionState } from 'react';
image

It causes a deployment error on Vercel:

image

It is fixed updating @types/react from 18.2.21 to 18.3.3 in package.json

  ...
  "devDependencies": {
  ...
    "@types/react": "18.3.3",
  ...
leerob commented 1 week ago

Thank you! This has been fixed.