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

206
Vistas
Why redirect not working in next.js application?

I am new to next.js and i have an application built on top of it. I run a timer of 10 seconds on the homepage and when the timer reaches 0 I want otredirect user to a feedpack page in my pages folder.

Code for the same:

if(timer==0)
  {
    navigate('/feedback')
    clearTimeout(time);
  }

I am using useNavigate hook here and it gives me the following error:

useNavigate() may be used only in the context of a <Router> component.
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Here you can read more about this error

What you need is to use useRouter hook.

import { useRouter } from 'next/router'

if(timer==0)
{
  router.push('/feedback')
  clearTimeout(time);
 }
about 4 years ago · Juan Pablo Isaza Denunciar
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