react-router-navigation-prompt
Advanced tools
Comparing version 1.1.2 to 1.2.1
{ | ||
"name": "react-router-navigation-prompt", | ||
"version": "1.1.2", | ||
"version": "1.2.1", | ||
"description": "A replacement component for the react-router `<Prompt/>`. Allows for more flexible dialogs.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -30,3 +30,3 @@ import React from 'react'; | ||
this.unblock = props.history.block((nextLocation, action) => { | ||
if (props.when) { | ||
if (this.props.when) { | ||
this.setState({ | ||
@@ -38,3 +38,3 @@ action, | ||
} | ||
return !props.when; | ||
return !this.props.when; | ||
}); | ||
@@ -88,3 +88,3 @@ this.state = {action: null, nextLocation: null, isActive: false}; | ||
render() { | ||
if (!this.state.isActive) return null; | ||
if (!this.state.isActive && !this.props.renderIfNotActive) return null; | ||
return ( | ||
@@ -91,0 +91,0 @@ <div> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
217401