Skip to content

Commit 6984737

Browse files
factions-user
authored andcommitted
fix(react-router-busy): Broaden peer dependency requirements
GitOrigin-RevId: 7a54b1414cb2e80a47b4aa297d38e6d08bdb48da
1 parent 9dd5b8f commit 6984737

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Improve your app's UX with just an import. A simple and performant package for accessible form input, button, and link **loading states**.
44

5+
For use with [react-router](https://github.com/remix-run/react-router) 6+ or [remix](https://github.com/remix-run/react-router) 2+.
6+
57
## The problem
68

79
![Editing input after submitting](https://github.com/user-attachments/assets/cc6f5a95-c2c8-4877-82ce-7dee317e063e)
@@ -12,14 +14,14 @@ Improve your app's UX with just an import. A simple and performant package for a
1214

1315
Render `BusyForm` instead of `Form` or `fetcher.Form`:
1416
* All the form's inputs will become `readonly` during submission to prevent someone from changing input data during submission and causing themselves confusion. The `cursor` will be `wait` if hovering over an input.
15-
* The form's submit button will become `aria-busy="true"` during submission to prevent double-clicking and causing extraneous requests. The `cursor` will be `wait` if hovering over the button, and `pointer-events` will be `none` to actually prevent clicking. A keyboard user can currently still repress the button though because I haven't found a way to prevent it.
17+
* The form's submit button will become `aria-busy="true"` during submission to prevent double-clicking and causing extraneous requests. The `cursor` will be `wait` if hovering over the button, and `pointer-events` will be `none` to actually prevent clicking.
1618

17-
I chose these attributes instead of `disabled` because it causes the field to not be sent in the form data and it's not accessibility friendly.
19+
This library doesn't make inputs `disabled` because it causes the field to not be sent in the form data and it's not accessibility friendly to dynamically toggle.
1820

1921
#### With navigation
2022

2123
```tsx
22-
import {BusyForm} from 'react-router-busy';
24+
import { BusyForm } from 'react-router-busy';
2325

2426
...
2527

@@ -37,7 +39,7 @@ return (
3739
#### With fetcher
3840

3941
```tsx
40-
import {BusyForm} from 'react-router-busy';
42+
import { BusyForm } from 'react-router-busy';
4143

4244
...
4345

@@ -58,10 +60,10 @@ return (
5860

5961
### BusyLink
6062

61-
This library assumes all your buttons are in forms. But links are another story, so `BusyLink` is a replacement for `Link` to add this functionality for relative paths.
63+
This library assumes all your buttons are in forms. But links are another story, so `BusyLink` is a replacement for `Link` to add this functionality for URLs to your app.
6264

6365
```tsx
64-
import {BusyLink} from 'react-router-busy';
66+
import { BusyLink } from 'react-router-busy';
6567

6668
...
6769

@@ -76,6 +78,7 @@ return (
7678

7779
## To do
7880

81+
- Fix a keyboard user still being able re-press the button
7982
- NavLink, Better not to have all that extra code for the `as` prop
8083
- Also export as Form and Link in case consumers prefer not replacing name
8184
- Make an option where you can edit the inputs after submission which cancels the current submission

packages/react-router-busy/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"check-exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm"
3939
},
4040
"peerDependencies": {
41-
"react-router-dom": "^6.26.2",
42-
"react": "^18.3.1"
41+
"react-router-dom": "^6.0.0",
42+
"react": "^18.0.0"
4343
},
4444
"//devDependencies": "Need vite for css module import when building",
4545
"devDependencies": {
@@ -59,6 +59,6 @@
5959
"@semantic-release/npm",
6060
"@semantic-release/github"
6161
],
62-
"dryRun": true
62+
"dryRun": false
6363
}
6464
}

0 commit comments

Comments
 (0)