I'm trying to update an URL based on value of a dropdown. Through what function can I update the URL.
handleChange = (e) => {
// update client code
this.setState({ clientcode: e.target.value.substr(0, 5),
value: e.target.value,
});
// now update url
// this.props.history.push('/v4/adminv2/web.php/client-onboard/family-management/api/packet?clientcode=' + this.state.clientcode);
const state = "";
const title = "";
const url = '/v4/adminv2/web.php/client-onboard/family-management/api/packet?clientcode=' + this.state.clientcode;
window.history.pushState(state, title, url);
}
For every change in dropdown, the this.state.clientcode in the URL needs to be updated and reload the page.
Couldn't see any change in the url after change in dropdown value.