FrontEnd
[짤막글][Concurrent Mode] 비동기 모드 사용 방법
DevInvestor
2021. 12. 23. 23:39
반응형
index.js에서 딱 세줄이면 된다.
cost rootEl = document.getElementById('root');
const root = ReactDOM.createRoot(rootEl);
root.render(<App/>); // 마운트
root.unmount(); // 언마운트
비동기 모드를 사용하는 이유?
렌더링이 인터랙션을 막지 않도록 잡 스케줄링을 할 수 있게 렌더링 작업을 쪼개 수행하기 위함
반응형