Open eubnara opened 3 years ago
함수적 갱신(functional update): https://reactjs.org/docs/hooks-reference.html#functional-updates
https://stackoverflow.com/questions/53215285/how-can-i-force-a-component-to-re-render-with-hooks-in-react
const [, updateState] = React.useState(); const forceUpdate = React.useCallback(() => updateState({}), []);
함수적 갱신
사전 지식
함수적 갱신(functional update): https://reactjs.org/docs/hooks-reference.html#functional-updates
강제 리렌더링 트릭
https://stackoverflow.com/questions/53215285/how-can-i-force-a-component-to-re-render-with-hooks-in-react
함수적 갱신
을 하고 같은 값이 되더라도 강제 업데이트를 하고 싶을 때 forceUpdate 를 호출할 수 있다.