How To A Create NavLink Component in NextJS
Make your own active link component with useRouter and TypeScript
Published in
3 min readApr 11, 2021
One of the first components I create while making a new NextJS application is a NavLink
component. This component wraps Next's next/link
component and adds an activeClassName
if that link is active. If you’ve worked with React Router before, you are most likely familiar with their…