React로 웹만들때 귀찮다고 (특히 antd, bootstrap같은 css라이브러리 커스터마이징할때)
<div style={{ marginTop: 10 }}>
이렇게 style에 객체 넣어버리는데
객체끼리의 비교는 무조건 false 가 나온다.
false
이전 DOM이랑 비교하는 React 동작방식 특성상
쓸모없는 리렌더링이 일어난다.
해결방법 : useMemo, styled-components
useMemo
styled-components
useMemo 좋더라구요!
useMemo 좋더라구요!