I have been following from this blog, so far the my custom modal works when i click to another route/link.
The only problem of this implementation is that, the custom modal does not work when I refresh, instead it pops out the built-in confirm alert.
I have here my custom modal.
const CustomConfirm = ({ content, title, isBlocked }) => {
// some codes here (from the blog)
return (
<>
<Prompt when message={handleBlockedRoute} />
{isModalOpen && (
<ConfirmationModal
showConfirmationModal={true}
setShowConfirmationModal={(value) => console.log(value)}
message={title}
handleOk={handleConfirmNavigationClick}
handleCancel={closeModal}
/>
)}
</>
);
};
export default CustomConfirm;
Can we possibly pop out a custom modal before refresh occur?