HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
💌
JJong’s Archive
/
컴포넌트 속성과 값 이름이 같을 때

컴포넌트 속성과 값 이름이 같을 때

Study Date
Dec 27, 2024 04:20 AM
Status
Tags
값이 객체에서 나온거라면
{…객체}로 속성을 줄 수 있다!
const products: { id: number; title: string; price: number; image: string; created_at: Date; }[] <ProductItem key={index} {...product} /> const ProductItem = ({id, image, title, price, created_at}:ProductItemProps) => { ... }