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.