Closed camcam2605 closed 1 year ago
This isn't related to progressbar, you can achieve this using useEffect
and next/router
events
React.useEffect(() => {
Router.events.on('routeChangeStart', routeChangeStart);
Router.events.on('routeChangeComplete', routeChangeEnd);
Router.events.on('routeChangeError', routeChangeError);
return () => {
Router.events.off('routeChangeStart', routeChangeStart);
Router.events.off('routeChangeComplete', routeChangeEnd);
Router.events.off('routeChangeError', routeChangeError);
};
}, []);
support onProgressStart, onProgressComplete, onProgressError,