0

I have a React app being built and then served by an express server. I need to be able to access a query parameter url.com/?param=somevalue in the URL from within the React app (not the server). The app will then fetch data from an API using the parameter value

As the app is very simple it does not require any routing, thus I'm not using any routing such as react-router. Is there a simple way to achieve this?

opamp
  • 1
  • What have you tried so far? What error are you getting? This simple google search may help: https://www.google.com/search?q=react+get+url+params&oq=react+get+url+p – Rastalamm Oct 03 '19 at 14:29
  • Best answer is here : https://stackoverflow.com/questions/29852998/getting-query-parameters-from-react-router-hash-fragment – Charlie Rabiller Oct 03 '19 at 14:30

0 Answers0