React doesn’t handle URL search parameters. You need to look in the window
object for them instead. Here’s how you would get the value of query
:
let search = window.location.search;
let params = new URLSearchParams(search);
let foo = params.get('query');