use-force-update
Force component to render without state change
Import
Source
Docs
Package
Usage
Hook returns a function, when this function is called component rerenders:
mantine-3ox9w9vye
import { Button, Text, Group } from '@mantine/core';import { useForceUpdate, randomId } from '@mantine/hooks';function Demo() {const forceUpdate = useForceUpdate();return (<Group position="center"><Text>{randomId()}</Text><Button onClick={forceUpdate}>Force update</Button></Group>);}
Definition
function useForceUpdate(): () => void;
Built by Vitaly Rtishchev and these awesome people