export function useForceUpdate(): () => void
Returns a function that forcibly updates the component.
import { afc, useForceUpdate } from 'react-afc' function Component(props) { const forceUpdate = useForceUpdate() return () => <> <p>Random number: {Math.random()}</p> <button onClick={forceUpdate}> Force update </button> </> } export default afc(Component)
There was an error while loading. Please reload this page.
Component
Lifecycle
State
Redux
Other