Skip to content

[next/navigation] Next 13: useRouter events? #41934

Answered by leerob
waltergalvao asked this question in Help
Discussion options

You must be logged in to vote

Hey everyone, I appreciate your patience here while we worked on a reply. Thanks for answering some of the questions I asked as it helped us collect a list of current solutions. Please let us know if this helps!

Current Solutions

Displaying a progress indicator while a route transition is happening

All navigations in the Next.js App Router are built on React Transitions. This means you can use the useTransition hook and use the isPending flag to understand if a transition is currently in-flight. For example:

'use client';

import { useTransition } from 'react';
import NextLink from 'next/link';
import { useRouter } from 'next/navigation';

/**
 * A custom Link component that wraps Next.js…

Replies: 49 comments 128 replies

Comment options

You must be logged in to vote
6 replies
@thelonewolf123
Comment options

@Fox32
Comment options

@dstarosta
Comment options

@NK3678
Comment options

@iamsabbirsobhani
Comment options

Comment options

You must be logged in to vote
3 replies
@tinnohofficial
Comment options

@petedegraw
Comment options

@pbs-jmo
Comment options

Comment options

You must be logged in to vote
2 replies
@joe-pellegrino
Comment options

@a95tbirdsc
Comment options

Comment options

You must be logged in to vote
3 replies
@saeideh-abs
Comment options

@stevenlafl
Comment options

@aminrms
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@pfischer1290
Comment options

@fdev
Comment options

@neilpoulin
Comment options

@fabb
Comment options

@SalahAdDin
Comment options

Comment options

You must be logged in to vote
1 reply
@pfischer1290
Comment options

Comment options

You must be logged in to vote
2 replies
@Fiontan
Comment options

@iamsabbirsobhani
Comment options

Comment options

You must be logged in to vote
3 replies
@samuhmatos
Comment options

@neilpoulin
Comment options

@SalahAdDin
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@samuhmatos
Comment options

@praveennagaraj97
Comment options

@samuhmatos
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@samuhmatos
Comment options

Comment options

You must be logged in to vote
5 replies
@MarcoBeyer
Comment options

@reo-yamashita
Comment options

@samuhmatos
Comment options

@pfischer1290
Comment options

@samuhmatos
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@arshad-yaseen
Comment options

@jdevcc
Comment options

Comment options

You must be logged in to vote
8 replies
@Santiago-j-s
Comment options

@SalahAdDin
Comment options

@josephlodero
Comment options

@sriechersrc
Comment options

@dmitri-gb
Comment options

Answer selected by waltergalvao
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@leerob
Comment options

Comment options

You must be logged in to vote
7 replies
@leerob
Comment options

@SalahAdDin
Comment options

@eiskalteschatten
Comment options

@leerob
Comment options

@SalahAdDin
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@leerob
Comment options

@kcrwfrd
Comment options

Comment options

You must be logged in to vote
1 reply
@jan0991
Comment options

Comment options

You must be logged in to vote
4 replies
@kcrwfrd
Comment options

@mycolaos
Comment options

@kcrwfrd
Comment options

@mycolaos
Comment options

Comment options

You must be logged in to vote
2 replies
@eiskalteschatten
Comment options

@axe312ger
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet