Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!