adding parameters to url react router 1

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}`
		);

Here is what the above code is Doing:
1. We’re getting the car_make_id, car_model_id, car_generation_id, car_serie_id, car_trim_id, and car_equipment_id from the state.
2. We’re using the history.push method to redirect the user to the product page.
3. We’re passing the car_make_id, car_model_id, car_generation_id, car_serie_id, car_trim_id, and car_equipment_id as query parameters.

Similar Posts