dioscarey / react-beforeunload-component Goto Github PK
View Code? Open in Web Editor NEWReact before unload component
License: MIT License
React before unload component
License: MIT License
When i try this in the codesandbox example, it doesn't block the route change neither on chrome, nor on firefox:
Is that a recent browser change or a bug in the package?
Can I call custom function for cancel & leave button without custom modal ?
I am able to get the leave changes
modal working and it pops up when I try to close/refresh my popup window. I passed in a custom component in modalComponentHandler
but the default alert is still coming. Is this usage correct from this article, am I missing something here?
Heres the the simplified component code ->
const UnsavedChangesModal = ({showUnsavedModalCallback }) => {
const hideModal = () => {
showUnsavedModalCallback(false);
};
return (
<Modal id='prompt' size='small'>
<ModalHeader
id='prompt-header'
title={meta.localeBundle['navigateAwayUnsavedChanges_header_label']}
closeButton={true}
onClose={hideModal}
/>
<ModalBody id='prompt-body'>{meta.localeBundle['navigateAway_message']}</ModalBody>
<ModalFooter id='prompt-footer'><Button
id='ok-button'
type='primary'
onClick={hideModal}>
{meta.localeBundle['ok_button_label']}
</Button></ModalFooter>
</Modal>
);
}
Thanks for the component btw.
Hi! Are there any plans for typescript support in foreseeable future? I may contribute in this topic.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.