Socket
Socket
Sign inDemoInstall

react-router-navigation-prompt

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-navigation-prompt - npm Package Compare versions

Comparing version 1.8.11 to 1.8.12

4

CHANGELOG.md

@@ -7,2 +7,6 @@ # Changelog

## [1.8.12] - 2020-06-19
### Changed
- Enhanced README.md
## [1.8.11] - 2020-04-16

@@ -9,0 +13,0 @@ ### Fixed

2

package.json
{
"name": "react-router-navigation-prompt",
"version": "1.8.11",
"version": "1.8.12",
"description": "A replacement component for the react-router `<Prompt/>`. Allows for more flexible dialogs.",

@@ -5,0 +5,0 @@ "scripts": {

@@ -21,5 +21,5 @@ # React Router <NavigationPrompt/>

Note: Currently tested using only react-router's `BrowserHistory`. `HashHistory` has issues: https://github.com/ZacharyRSmith/react-router-navigation-prompt/issues/36
**Note: Currently tested using only react-router's `BrowserHistory`. `HashHistory` has issues: https://github.com/ZacharyRSmith/react-router-navigation-prompt/issues/36**
Note: Navigation away from your site, reload, or closing tab/window will also prompt navigation confirmation when `<NavigationPrompt/>`'s `props.when` is truthy. However, for security concerns browsers usually handle this navigation UX themselves, leading to vanilla alert boxes. Also, many browsers require users to interact with your site before confirming navigation away.
**Note: Navigation away from your site, reload, or closing tab/window will also prompt navigation confirmation when `<NavigationPrompt/>`'s `props.when` is truthy. However, for security concerns browsers usually handle this navigation UX themselves, leading to vanilla alert boxes. Also, many browsers require users to interact with your site before confirming navigation away.**

@@ -32,8 +32,12 @@ Motivation: https://github.com/ReactTraining/react-router/issues/4635

A visual example of `<Prompt />` vs the package in action:
Below is a gif of `<Prompt />` and a gif of `<NavigationPrompt />`, with links to sandboxes to try them yourself:
![demo-gif](https://media.giphy.com/media/2t9sbep1TtRTHF2YJD/giphy.gif)
This gif shows react-router's `<Prompt />`, which relies on the browser's alert boxes. You can try it [here](https://codesandbox.io/s/sleepy-dubinsky-3yc4k?file=/src/index.js)
![demo-gif](https://media.giphy.com/media/oVkikQIhaZIzcEBK70/giphy.gif)
![demo 1 gif](https://media.giphy.com/media/2t9sbep1TtRTHF2YJD/giphy.gif)
This gif shows `<NavigationPrompt />`, which enables custom dialogs _except when the browser requires a vanilla alert box for security reasons_. You can try it [here](https://9q3wn56zrp.codesandbox.io)
![demo 2 gif](https://media.giphy.com/media/oVkikQIhaZIzcEBK70/giphy.gif)
## Example Usage

@@ -40,0 +44,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc