Next.js 16 App Router로 마이그레이션 중인데, 기존 ThemeContext를 RSC 안에서 쓰려고 하니까 동작 자체를 안 합니다.
구조는 app/layout.tsx에서 ThemeProvider로 감쌌고, RSC인 app/page.tsx 안에서 useContext(ThemeContext) 호출하니 "Cannot read properties of null"이 떨어집니다.
Provider는 'use client'를 붙여서 클라이언트 컴포넌트로 만들었는데도 RSC에서 못 가져오네요. 어떻게 처리해야 하나요?
댓글 0