Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 96b3425

Browse files
fix(usePopper): fix exported Modifier type (#1013)
* Update yarn.loack * Update package.json * Update usePopper.ts * format input by prettier * update yarn.lock with @popperjs/core@2.11.6; allow to use undefined for the 2nd argument in Modifier
1 parent 4fcf758 commit 96b3425

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
},
5959
"dependencies": {
6060
"@babel/runtime": "^7.13.8",
61-
"@popperjs/core": "^2.8.6",
61+
"@popperjs/core": "^2.11.6",
6262
"@restart/hooks": "^0.4.7",
6363
"@types/warning": "^3.0.0",
6464
"dom-helpers": "^5.2.0",

‎src/usePopper.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@ const initialPopperStyles = (
1515

1616
const disabledApplyStylesModifier = { name: 'applyStyles', enabled: false };
1717

18+
// In order to satisfy the current usage of options, including undefined
19+
type OptionsWithUndefined<
20+
T extends Popper.Obj | undefined
21+
> = T extends Popper.Obj ? T : Popper.Obj;
22+
1823
// until docjs supports type exports...
19-
export type Modifier<Name, Options> = Popper.Modifier<Name, Options>;
24+
export type Modifier<
25+
Name,
26+
Options extends Popper.Obj | undefined
27+
> = Popper.Modifier<Name, OptionsWithUndefined<Options>>;
28+
2029
export type Options = Popper.Options;
2130
export type Instance = Popper.Instance;
2231
export type Placement = Popper.Placement;

‎yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,10 +1535,10 @@
15351535
dependencies:
15361536
mkdirp "^1.0.4"
15371537

1538-
"@popperjs/core@^2.8.6":
1539-
version "2.8.6"
1540-
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.8.6.tgz#ad75ebe8dbecfa145af3c7e4d0ae98016458d005"
1541-
integrity sha512-1oXH2bAFXz9SttE1v/0Jp+2ZVePsPEAPGIuPKrmljWZcS3FPBEn2Q4WcANozZC0YiCjTWOF55k0g6rbSZS39ew==
1538+
"@popperjs/core@^2.11.6":
1539+
version "2.11.6"
1540+
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45"
1541+
integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==
15421542

15431543
"@react-bootstrap/eslint-config@^1.3.2":
15441544
version "1.3.2"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /