!nextLocation || !nextLocation.pathname.startsWith(crntLocation.pathname)}
+ when={(crntLocation, nextLocation) =>
+ !nextLocation || !nextLocation.pathname.startsWith(crntLocation.pathname)
+ }
>
- {({isActive, onCancel, onConfirm}) => {
+ {({ isActive, onCancel, onConfirm }) => {
if (isActive) {
return (
@@ -64,27 +78,23 @@ import Modal from './your-own-code';
);
}
- return (
- This is probably an anti-pattern but ya know...
- );
+ return This is probably an anti-pattern but ya know...
;
}}
-
+;
```
## API
-* `props`
- * afterCancel?: Function,
- * afterConfirm?: Function,
- * beforeCancel?: Function,
- * beforeConfirm?: Function,
- * children: (data: {isActive: bool, onCancel: Function, onConfirm: Function}) => React$Element<*>,
- * renderIfNotActive: bool,
- * when: bool | (Location, ?Location) => bool,
- * disableNative: bool,
- // Added by react-router:
- * match: Match,
- * history: RouterHistory,
- * location: Location,
-
-
+- `props`
+ - afterCancel?: Function,
+ - afterConfirm?: Function,
+ - beforeCancel?: Function,
+ - beforeConfirm?: Function,
+ - children: (data: {isActive: bool, onCancel: Function, onConfirm: Function}) => React$Element<\*>,
+ - renderIfNotActive: bool,
+ - when: bool | (Location, ?Location) => bool,
+ - disableNative: bool,
+ // Added by react-router:
+ - match: Match,
+ - history: RouterHistory,
+ - location: Location,
diff --git a/package.json b/package.json
index 4784093..c92feeb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-router-navigation-prompt",
- "version": "1.6.4",
+ "version": "1.6.5",
"description": "A replacement component for the react-router `