Considering below hooks example
import { useState } from \'react\'; function Example() { const [count, setCount] = useState(0); return
My variation of forceUpdate is not via a counter but rather via an object:
forceUpdate
counter
// Emulates `forceUpdate()` const [unusedState, setUnusedState] = useState() const forceUpdate = useCallback(() => setUnusedState({}), [])
Because {} !== {} every time.
{} !== {}