Open Immo-Be opened 2 years ago
Hi, it sounds like a nice feature, if it were already implemented how its DSL would look?
I'd say a good implementation would be react-router where the user is prompted with a message when a certain state is entered. The prompt component is then rendered like:
<Prompt when={formIsHalfFilledOut} message="Are you sure you want to leave?" />
Ideally, message
would accept not only a string but also a function
See here for more details
Hey! :)
With react-router there is the prompt component that prevents a user to navigate to another page (e.g. when there are unsaved changes in a form). It would be nice to implement a functionality like that.