How to use useRouter() from next.js in a class component?

Posted by Prem Tiwari | Updated on

How to use useRouter() from next.js in a class component?

In general, it’s possible to create a wrapper functional component to pass custom hooks into class components via props (but not useful in this case):


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers