Skip to content

Commit 0bc9823

Browse files
committed
⬆️ upgrade dependencies
Signed-off-by: w01gang <[email protected]>
1 parent f4b17cd commit 0bc9823

3 files changed

Lines changed: 1219 additions & 1023 deletions

File tree

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
"test": "jest"
1818
},
1919
"devDependencies": {
20-
"@testing-library/jest-dom": "5.16.3",
21-
"@testing-library/react": "13.0.0",
22-
"@testing-library/react-hooks": "7.0.2",
23-
"@types/jest": "27.4.1",
24-
"@types/react-dom": "17.0.14",
25-
"@typescript-eslint/eslint-plugin": "5.17.0",
26-
"@typescript-eslint/parser": "5.17.0",
27-
"eslint": "8.12.0",
28-
"jest": "27.5.1",
29-
"react": "18.0.0",
30-
"react-dom": "18.0.0",
31-
"ts-jest": "27.1.4",
32-
"typescript": "4.6.3"
20+
"@testing-library/jest-dom": "5.16.5",
21+
"@testing-library/react": "13.4.0",
22+
"@testing-library/react-hooks": "8.0.1",
23+
"@types/jest": "29.1.2",
24+
"@typescript-eslint/eslint-plugin": "5.39.0",
25+
"@typescript-eslint/parser": "5.39.0",
26+
"eslint": "8.25.0",
27+
"jest": "29.1.2",
28+
"jest-environment-jsdom": "^29.1.2",
29+
"react": "18.2.0",
30+
"react-dom": "18.2.0",
31+
"ts-jest": "29.0.3",
32+
"typescript": "4.8.4"
3333
},
3434
"files": [
3535
"/lib"

src/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import React, {
88
Ref,
99
ReactChild,
1010
ReactElement,
11+
PropsWithChildren,
1112
} from "react";
1213

1314
export type Rules = {
@@ -75,7 +76,7 @@ function Gate({ children, name, fallback, ...other }: ConsumerProps, ref: Ref<HT
7576

7677
if (!enabled) return fallback || null;
7778

78-
return cloneElement(children, { ref, ...other });
79+
return cloneElement(children as ReactElement<PropsWithChildren<ConsumerProps & { ref: Ref<HTMLElement> }>>, { ref, ...other });
7980
}
8081

8182
export const FeatureGate = forwardRef(Gate);
@@ -95,9 +96,9 @@ function Switch({ children, name, fallback, ...other }: SwitchProps, ref: Ref<HT
9596

9697
if (!present) return null;
9798

98-
if (!enabled) return cloneElement(fallback, { ref, ...other });
99+
if (!enabled) return cloneElement(fallback as ReactElement<PropsWithChildren<ConsumerProps & { ref: Ref<HTMLElement> }>>, { ref, ...other });
99100

100-
return cloneElement(children, { ref, ...other });
101+
return cloneElement(children as ReactElement<PropsWithChildren<ConsumerProps & { ref: Ref<HTMLElement> }>>, { ref, ...other });
101102
}
102103

103104
export const FeatureSwitch = forwardRef<HTMLElement, SwitchProps>(Switch);

0 commit comments

Comments
 (0)