728x90
원래 리액트에서는 바뀌지 않은 props까지 모두다 렌더링된다.
React.memo는 react.js한테 prop이 바뀌지 않는다면 컴포넌트를 렌더링 하지 말라고 한다.
최적화기술이다!!!
기존코드
function DragabbleCard() {
return (
<>
</>
);
}
export default DragabbleCard;
바뀐코드
import React from "react";
function DragabbleCard() {
return (
<>
</>
);
}
export default React.memo(DragabbleCard);
728x90
'부트캠프교육중 > react' 카테고리의 다른 글
[React] 다른 board끼리의 움직임 (0) | 2023.09.08 |
---|---|
[React] 같은 board안에서의 움직임 (0) | 2023.09.08 |
[React] Recoil 정리 (0) | 2023.09.05 |
[React] Recoil 2편 (0) | 2023.09.04 |
[React] Ts+eslint+prettier 기초셋팅설정 (0) | 2023.08.29 |