I am trying to extract a URL fragment using getServerSideProps. The URL is structured like this:
http://localhost:3000/some-folder#desiredParam=value
Even though I pass the context
as an argument to the getServerSideProps
function, I am struggling to retrieve the URL parameter because it's not in the format of
http://localhost:3000/some-folder?desiredParam=value
. If it were, I could simply use context.query.desiredParam
When I try using context.query.url
, it returns /some-folder
, and context.query
gives me null.
If only I could access the entire window.location
, I would split the string by #
. Unfortunately, that's not possible with getServerSideProps.
So my question remains: what steps can I take to retrieve the value of desiredParam?