2단계: Props를 활용한 카드
Coddy React 여정의 기초 (Fundamentals) 섹션에 포함된 레슨 — 42개 중 40번째.
챌린지
쉬움카드 구성 요소를 재사용 가능하게 만드세요.
name및bioprops를 전달받고, 전달받은 prop 값으로 1단계와 동일한 구조(card div,id="profile-name",id="profile-bio")를 렌더링하는ProfileCard를 정의하세요.- App에서 name이
Grace Hopper이고 bio가Invented the compiler인 ProfileCard 하나를 렌더링하세요.
직접 해보기
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div id="root"></div>
<script type="module" src="main.jsx"></script>
</body>
</html>