I want to use Gatsby's Link functionality inside a button. I am doing this cause I am having an easier time formatting the button to look like what I want as opposed messing with the Link formatting.
This is my old code
import { Link } from "gatsby"
<button>
<Link to="/event-details">Details</Link>
</button>
This is what what I am trying to get to work.
import { Link } from "gatsby"
<button onClick:'Link to = /page'>Page button</button>
import navigate
import { navigate } from "gatsby"
then in your button will be
<button onClick={()=>{navigate("/page")}}>Page button</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With