Optimization (1) 썸네일형 리스트형 리액트 성능 최적화 : children props를 이용하여 리렌더링 방지 재미있는 글을 봤습니다. https://kentcdodds.com/blog/optimize-react-re-renders One simple trick to optimize React re-renders Without using React.memo, PureComponent, or shouldComponentUpdate kentcdodds.com 부모 컴포넌트가 리렌더링되면 자식들은 다 리렌더링 되는거 아닌가요? 그런데 children들이 리렌더링 되지 않는 경우가 있다고요? React는 리렌더링 시 전달된 children 객체에 대하여 얕은 비교를 수행합니다. 즉, 전달된 children이 동일한 객체이면 리렌더링을 수행하지 않습니다. (React.memo는 1단계 깊이 비교를 수행하는 것으로 알고 있.. 이전 1 다음