Renu prashanth M
Renu prashanth M

Reputation: 1

cancel button should refresh the page

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

Answers (1)

Scario Eva
Scario Eva

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

Related Questions