0.3.1 ā€¢ Published 2 years ago

@byungi/react-router-prompt v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

A replacement component for the react-router 6 Prompt. Allows for more flexible dialogs.

šŸ  Homepage

āœØ Demo

Install

yarn add react-router-prompt

Usage

<ReactRouterPrompt when={isDirty}>
  {({ isActive, onConfirm, onCancel }) => (
    <Modal show={isActive}>
      <div>
        <p>Do you really want to leave?</p>
        <button onClick={onCancel}>Cancel</button>
        <button onClick={onConfirm}>Ok</button>
      </div>
    </Modal>
  )}
</ReactRouterPrompt>

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

Show your support

Give a ā­ļø if this project helped you!

Credits

šŸ“ License

Copyright Ā© 2022 Shyam Gupta (shyamm@outlook.com). This project is MIT licensed.

Author

šŸ‘¤ Shyam Gupta (shyamm@outlook.com)