use-interval
Calls function with a given interval
Source
Docs
PackageIcon
Usage
Page loaded 0 seconds ago
Auto invoke interval
To automatically start the interval when the component is mounted, set the autoInvoke option to true:
API
Arguments:
fn– function that is called at each interval tickinterval– amount of milliseconds between each tick
Return object:
start– start the intervalstop– stop intervaltoggle– toggle intervalactive– current interval status
Definition
Exported types
UseIntervalOptions and UseIntervalReturnValue types are exported from the @mantine/hooks package;
you can import them in your application: