add params to url react code example
Example 1: append a query string to the url react
history.push({
pathname: '/dresses',
search: '?color=blue'
})
Example 2: adding parameters to url react router
history.push(
`/product?make=${car_make_id}&model=${car_model_id}&year=${car_generation_id}&series=${car_serie_id}&engine=${car_trim_id}&variant=${car_equipment_id}`
);
Example 3: history push search params
this.props.history.push({
pathname: '/client',
search: "?" + new URLSearchParams({clientId: clientId}).toString()
})