-
Notifications
You must be signed in to change notification settings - Fork 0
useForceUpdate
Александр edited this page Jan 17, 2023
·
1 revision
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)
Component
Lifecycle
State
Redux
Other