useProgress
Use `useProgress` hook
The useProgress
hook is used to manipulate the progress state.
Import
Note
Replace the ...
in the import with the library you're using. For example, if
you use @bprogress/next
, import by doing from '@bprogress/next'
Usage
Methods
start
Start the progress bar.
stop
Stop the progress bar.
inc
Increase the progress bar (between 0 and 1).
dec
Decrease the progress bar (between 0 and 1).
set
Set the progress bar (between 0 and 1).
pause
Pause the progress bar.
resume
Resume the progress bar.
setOptions
Set the progress bar options.
getOptions
Get the progress bar options.
isAutoStopDisabled
Check if the auto stop is disabled.
Note
When you navigate between pages, the stop is played automatically, so if you don't want the progress to stop by itself when you manipulate the URL, this ref is useful.
disableAutoStop
Disable the auto stop.
enableAutoStop
Enable the auto stop.