[Next.js] use client란? Next의 클라이언트 컴포넌트와 서버 컴포넌트 구분하여 사용하기
주사위 clice:
문제상황 Next.js 환경에서 페이지를 구현하고 있었다모든 코드에서 문제 없는데, localhost에 접속하니 이런 build error가 떴다 You'r importing a compoenet 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.Learn more: https://nextjs.org/docs/getting-started/react-essentials 에러 메세지를 읽어보니 useState를 쓰려면 use client를 명시해야 한다고 한다 해결 방법 해결 방법은 간단하..