Reputation: 1
I have a cancel button it should not update the data into database and it should refresh my page,but in my case page is not refreshing
<Button onClick={() => searchDiagnosisCode()}>Cancel</Button>
const searchDiagnosisCode = () => {
props.setConfirm(true);
setTimeout(function () {
props.history.push({
pathname: '/DiagnosisCodeSearch',
editPage: true,
});
}, 10);
};
Upvotes: 0
Views: 144
Reputation: 257
try window.location.reload();
to refresh the page
<Button onClick={() => searchDiagnosisCode()}>Cancel</Button>
const searchDiagnosisCode = () => {
props.setConfirm(true);
setTimeout(function () {
window.location.reload();
}, 10);
Upvotes: 1