I'm trying to get "query=123" from the url http://localhost:3000/?query=123. Tried
//App.js
const search = this.props.location.search;
const params = new URLSearchParams(search);
const foo = params.get('foo');
console.log(this.props);
and my console shows this https://d.pr/i/w5tAYF
which doesn't show location.search anywhere... any idea how I would get the query string?








this.props.location.searchdoesn't contain the query. You need to look inwindow.location.search.