Considering below hooks example
import { useState } from \'react\'; function Example() { const [count, setCount] = useState(0); return
One line solution:
const useForceUpdate = () => useState()[1];
useState returns a pair of values: the current state and a function that updates it - state and setter, here we are using only the setter in order to force re-render.