![]() However, I noticed a few caveats with this component. location.pathname = "/foo" ? true : "Denied"} /> You can also pass a message that will get displayed or a function that takes a location and returns true to allow navigation or a message to prevent. The when prop can be set to enable/disable this functionality dynamically which is great. The purpose of this component is to show a dialog to the user during a router transition. React Router core has a component called Prompt. Since we're leveraging React Router v4, I looked into what was provided out of the box to see how customizable it was. The intention was to ensure they saved their changes as it affected other parts of the data they're working on and we need to recompute business rules (fun, huh?). We had a recent requirement on our project to prompt the user with a custom modal when they have some pending changes to save in our application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |