The simple below component is throwing the following error in Next.js's app
directory when I use useState
:
You're importing a component that needs useState. It only works in a Client Component, but none of its parents are marked with "use client", so they're Server Components by default.
import { useState } from "react";
export default function Card() {
const [state, setState] = useState("");
return <></>;
}