4단계: 팔로우 토글
Coddy React 여정의 기초 (Fundamentals) 섹션에 포함된 레슨. 42개 중 42번째.
챌린지
중급프로필 카드를 완성하세요.
ProfileCard에 불리언 상태following을 추가하세요(초깃값은false).- 클릭하면 상태를 전환하는
id="follow"버튼을 추가하세요. - 참일 때 버튼 레이블은
Following이고, 거짓일 때는Follow입니다.
직접 해보기
<!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>