Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unstable_useBlocker -> useBlocker for react-router@6.19 #124

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

### Prerequisite

**React-router-dom >= 6.7** and can be used only with [**data routers**](https://reactrouter.com/en/6.8.1/routers/picking-a-router#using-v64-data-apis)
**React-router-dom >= 6.19** and can be used only with [**data routers**](https://reactrouter.com/en/6.8.1/routers/picking-a-router#using-v64-data-apis)

```bash
pnpm add react-router-prompt
Expand Down Expand Up @@ -69,7 +69,7 @@ yarn add react-router-prompt

#### Note 🗒️

This version works with react-router-dom >=v6.7
This version works with react-router-dom >=v6.19
Should be used within [data routers](https://reactrouter.com/en/6.8.1/routers/picking-a-router#using-v64-data-apis)

For react-router-support `(v6 - v6.2.x)` please install v0.3.0
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"prettier": "^2.8.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.8.1",
"react-router-dom": "^6.19.0",
"size-limit": "^8.1.2",
"tslib": "^2.5.0",
"typescript": "^5.0.0",
Expand All @@ -85,7 +85,7 @@
"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8",
"react-router-dom": ">=6.7"
"react-router-dom": ">=6.19"
},
"size-limit": [
{
Expand Down
28 changes: 14 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/hooks/use-prompt.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useEffect } from "react"
import {
useBeforeUnload,
unstable_useBlocker as useBlocker,
useBlocker,
unstable_Blocker as Blocker,
unstable_BlockerFunction as BlockerFunction,
} from "react-router-dom"
Expand Down