add query params to route react code example
Example 1: append a query string to the url react
history.push({
pathname: '/dresses',
search: '?color=blue'
})
Example 2: get query params react
new URLSearchParams(this.props.location.search).get("your_query_param_key")
Example 3: history push search params
this.props.history.push({
pathname: '/client',
search: "?" + new URLSearchParams({clientId: clientId}).toString()
})