diff --git a/src/useForceUpdate.ts b/src/useForceUpdate.ts index a1f441c..6c32dc1 100644 --- a/src/useForceUpdate.ts +++ b/src/useForceUpdate.ts @@ -17,8 +17,6 @@ import { useReducer } from 'react' * ``` */ export default function useForceUpdate(): () => void { - // The toggling state value is designed to defeat React optimizations for skipping - // updates when they are stricting equal to the last state value - const [, dispatch] = useReducer((state: boolean) => !state, false) + const [, dispatch] = useReducer((state: number) => ++state, 0) return dispatch as () => void }