We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e632747 commit 65bbc09Copy full SHA for 65bbc09
packages/react-router/docs/api/Prompt.md
@@ -23,11 +23,15 @@ Will be called with the next `location` and `action` the user is attempting to n
23
24
```jsx
25
<Prompt
26
- message={location =>
27
- location.pathname.startsWith("/app")
+ message={(location, action) => {
+ if (action === 'POP') {
28
+ console.log("Backing up...")
29
+ }
30
+
31
+ return location.pathname.startsWith("/app")
32
? true
33
: `Are you sure you want to go to ${location.pathname}?`
- }
34
+ }}
35
/>
36
```
37
0 commit comments