Untitled
import TopBarProgress from 'react-topbar-progress-indicator'; // show progress-bar before change route TopBarProgress.config({ barColors: { 0: '#0b84b3' }, }); const [topProgressBar, setTopProgressBar] = useState<boolean>(false); Router.events.on('routeChangeStart', (): void => { setTopProgressBar(true); }); Router.events.on('routeChangeComplete', (): void => { setTopProgressBar(false); }); {topProgressBar && <TopBarProgress />}