I keep receiving the error message
Unhandled Runtime Error Error: Cancel rendering route
Within my navBar, I have implemented the following function:
const userData={
id:1,
email: "",
name: "",
lastName: "",
photo: "",
token: "",
onLine: false
}
const router = useRouter();
const logOut = () => {
dispatch( setUserLogged(userData) )
router.push('/');
}
I am using
import { useRouter } from 'next/router';
as well.
Including a button in my navBar:
<Link href="#" onClick={()=>logOut()} >
Log out
</Link>
By clicking on the "Log out" button in the navBar, the logOut
function is called and then I encounter the
Unhandled Runtime Error Error: Cancel rendering route
issue. What could be causing this error?