Replies: 2 comments
-
객체에 undefined값이 포함되어있다면 json serialization이 불가능함next.js에서 객체를 직렬화 할 때 undefined가 객체에 포함되어있으면 json serialization이 불가능 함. 특히 NextResponse 객체의 .json()을 사용할 때 주의해야 함.
참고
|
Beta Was this translation helpful? Give feedback.
0 replies
-
params는 next.js 15버전부터 promise 처럼 사용됨export default async function Foo({params}: { params: { uuid: string } }) {
const {uuid} = await params;
// ...
}params를 사용하는 컴포넌트는 await를 사용해야 함. 단 promise 객체처럼 취급하지만 promise 객체는 아니기 때문에 ESLINT에서 promise가 아닌데 왜 await쓰냐고 경고문 띄우는 문제가 발생할 수 있음. 경고 무시하면 됨. --
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
이 discussion은 next.js와 react 등 프론트앤드 개발 중 발견한 팁을 정리합니다.
Beta Was this translation helpful? Give feedback.
All reactions