I'm attempting to create a donation page on an existing Gatsby site. The 3rd-party donation form script generates, among other things, a text button to choose an alternative payment method. While other interactive elements are buttons and function as expected, this one is an element without an href. When clicking the link, instead of the plugin's modal appearing as expected, the page refreshes as Gatsby tries to route using the tag. Is there a way to prevent Gatsby for imposing any sort of router functionality on the generated link?
My first attempt had been to use gatsby-browser.js with onPreRouteUpdate, something like
export const onPreRouteUpdate = ({ location, prevLocation }) => {
if (location.pathname === 'donate' && prevLocation === 'donate') {
return;
}
}
But actually can't get any lifecycle methods that I've found yet to react to the link click. How can I get Gatsby to just mind its p's and q's about the specific link or really any empty href or # tag? Thanks in advance for any insights people might have!