STUDY/React
React | 이미지 onError처리 (img onError)
개미606
2020. 9. 21. 14:54
<img className="member_profile"
src={user.profileUrl}
alt="profile_img"
onError={handleImgError}
/>
const handleImgError = (e) => {
e.target.src = defaultProfile;
}