-
클라이언트 컴포넌트에서 서버 컴포넌트 넣기멈멈-토이프로젝트(next.js)2 2024. 8. 12. 17:42728x90
에러 발생
async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.
A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.
코드 상황
부모 컴포넌트 : 클라이언트
자식 컴포넌트 : 서버(비동기)
이게 가능한가...공문에서 찾아봄
Unsupported Pattern: Importing Server Components into Client Components The following pattern is not supported. You cannot import a Server Component into a Client Component:
서버 구성 요소를 클라이언트 구성 요소로 가져올 수 없습니다.
직접적으로 넣는건 안된다고 한다 코드 수정 해야겠다
props로 서버컴포넌트를 클라이언트 컴포넌트로 전달 하는건 가능!
'멈멈-토이프로젝트(next.js)2' 카테고리의 다른 글
다이어리 데이터 추가 하기 (0) 2024.08.29 폴더 구조 코드 리팩토링 (2) 2024.08.28 로그인 uid 리코일 과 세션 (0) 2024.08.07 카카오 로그인 적용 하기 (0) 2024.08.06 컴포넌트에서 이미지를 출력 (0) 2024.07.24