Created
April 14, 2020 16:49
-
-
Save dioscarey/53fa4ec65394103ce52e1ef73442d37a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import BeforeUnloadComponent from 'react-beforeunload-component'; | |
| // React Hook | |
| const Example = () => { | |
| return ( | |
| <div> | |
| <BeforeUnloadComponent | |
| blockRoute={true} | |
| /> | |
| <form> ... </form> | |
| <BeforeUnloadComponent /> | |
| </div> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment