Remove query params in getServerSideProps from url, but still pass data to component via props.
Unanswered
Pink salmon posted this in #help-forum
Pink salmonOP
Is there a way inside a pages
I can see at the bottom of the pages html that the props are being passed in a script tag, which makes sense how the component values are populated. But that means we don't need the query params in the url (and I don't want to muddy the url with all that data).
Any help would be much appreciated! 🙇
getServerSideProps function to remove the query params from the url but still pass data into the page component props?I can see at the bottom of the pages html that the props are being passed in a script tag, which makes sense how the component values are populated. But that means we don't need the query params in the url (and I don't want to muddy the url with all that data).
<script id="__NEXT_DATA__" type="application/json">
{"props":{"pageProps":{"title":"technicalDifficulties","message":"tryAgain","ctaText":"reloadPage","ctaLink":null,"serviceErrorCode":"500"},"__N_SSP":true},"page":"/error","query":{"title":"technicalDifficulties","message":"tryAgain","ctaText":"reloadPage","serviceErrorCode":"500"},"buildId":"development","isFallback":false,"gssp":true,"scriptLoader":[]}
</script>Any help would be much appreciated! 🙇