Using next/router outside of components #17046
-
Documentation states that I have to either use |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
You should be able to import the Router instance and then call import Router from 'next/router' |
Beta Was this translation helpful? Give feedback.
-
will (next/router) not work in app router? |
Beta Was this translation helpful? Give feedback.
-
Seems like we will wait for eternity untill Next releases redirect outside of components for app router |
Beta Was this translation helpful? Give feedback.
You should be able to import the Router instance and then call
Router.push
on it via: