Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

100
Vistas
isReady is true from next/route when using getInitialProps

In my application I'm using nextjs and I'm transition my app from static to SSR. On my custom App I introduced the getInitialProps function and I noticed that when I use getInitialProps function, my property isReady from the hook useRouter() is always true and the query object is empty when I have query parameters on the url.

Example:

const App = ({ Component, pageProps }: AppProps): JSX.Element => {   
   const router = useRouter()
   
 useEffect(() => {
    console.log('App route: ')
    console.log(router)
    console.log(router.isReady)
    console.log(router.query)

  }, [router])

 return ({router.isReady && <Component {...pageProps}/>})
  
}

On this scenario, what happens is that the query params "appear" later, and the console logs are printed twice due the later hydration (what makes sense). But shouldn't the isReady flag be false? on the first console? after the hydration?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda