React-router set query params code example
Example 1: append a query string to the url react
history.push({
pathname: '/dresses',
search: '?color=blue'
})
Example 2: history push search params
this.props.history.push({
pathname: '/client',
search: "?" + new URLSearchParams({clientId: clientId}).toString()
})
Example 3: maintain query params react-router
history.push('/app/measurements' + history.location.search)