I am using Gatsby and React for a website.
I want to display the query params from the URL on the page. I have something like:
const IndexPage () => {
const params = new URLSearchParams(location.search);
const DOI = params.get("doi");
return (
<div>{DOI}</div>
)
}
where the URL is https://apsum.netlify.app/?doi=123
, for example.
I want 123
to display on the page, but it is not.