This is my code. I'm having an error undefined reading push. I want to pass City to another component.
const onInputCityChangeHandler = (e) => {
setCity(e.target.value);
};
const submitForm = (e) => {
e.preventDefault();
props.history.push({pathname: "/",city,});
console.log(city);
};