I use routing next.js. How to implement the button back and return to the previous page? Just like with the button on the browser
next/link
does all the location.history handling for you. You don't need to write even a single line of client-side routing code. This does not take any attribute. Instead create a functional component
const BsNavLink=(props)=>{
const {route,title}=props
return ( {title})
}
In this case, the child of the next/link component is the anchor tag. It can also work with any other component or tag, the only requirement for components placed inside is that they should accept an
onClick
prop.