props
props
function Monster(props) {
return (
<div>
<h1>{props.name}</h1>
<p>번호 : {props.no}</p>
<p>속성 : {props.type}</p>
</div>
);
}function MainComponent(){
return (
<>
<Monster no={1} name={'이상해씨'} type={'풀'}/>
<Monster no={2} name={'파이리'} type={'불'}/>
<Monster no={3} name={'꼬부기'} type={'물'}/>
<Monster no={4} name={'피카츄'} type={'전기'}/>
</>
);
}정적 props
동적 props
실행 결과
결론
Last updated