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

Remove unstable references, removed wrapper div and update dependencies #133

Merged
merged 11 commits into from
Feb 17, 2024
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# react-router-prompt 🚨

> A component for the react-router 6 `Prompt`. Allows to create more flexible dialogs.
Expand Down Expand Up @@ -47,25 +46,25 @@ yarn add react-router-prompt

### Props

1. `when`: `boolean` | `BlockerFunction`
1. `when`: `boolean` | `BlockerFunction`

```ts
BlockerFunction = (args: {
currentLocation: Location;
nextLocation: Location;
historyAction: HistoryAction;
}) => boolean;
```
```ts
BlockerFunction = (args: {
currentLocation: Location
nextLocation: Location
historyAction: HistoryAction
}) => boolean
```

2. `beforeConfirm()` : `Promise<unknown>` _(Optional)_
2. `beforeConfirm()` : `Promise<unknown>` _(Optional)_

3. `beforeCancel()` : `Promise<unknown>` _(Optional)_
3. `beforeCancel()` : `Promise<unknown>` _(Optional)_

### Return values

1. `isActive`: `Boolean`
2. `onConfirm()`: `void`
3. `onCancel()`: `void`
1. `isActive`: `Boolean`
2. `onConfirm()`: `void`
3. `onCancel()`: `void`

#### Note 🗒️

Expand All @@ -76,7 +75,6 @@ For react-router support `(v6 - v6.2.x)` please install v0.3.0

For react-router support (v6.7.x - v6.18.x) please install v0.5.4


_Skipped support in middle due to breaking changes on react-router apis_

## Contributing
Expand Down