Skip to content

Commit 5420890

Browse files
committed
fix(ErrorBoundary-types): change children type to ReactElement
`@testing-library/react` introduced new type definition for `wrapper` in PR testing-library/react-testing-library#966, then released it in `v12.1.1`. issue testing-library/react-testing-library#970
1 parent 1b0400f commit 5420890

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@react-spring/types": "^9.2.4",
5151
"@testing-library/dom": "^8.6.0",
5252
"@testing-library/jest-dom": "^5.14.1",
53-
"@testing-library/react": "^12.1.0",
53+
"@testing-library/react": "^12.1.1",
5454
"@testing-library/react-hooks": "^7.0.2",
5555
"@testing-library/user-event": "^13.2.1",
5656
"@types/jest": "^27.0.2",

src/components/ErrorBoundary/ErrorBoundary.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Result, Typography } from 'antd';
2-
import React, { Component, ErrorInfo, ReactNode } from 'react';
2+
import React, { Component, ErrorInfo, ReactElement } from 'react';
33

44
interface Props {
5-
children: ReactNode;
5+
children: ReactElement;
66
}
77

88
interface State {
@@ -26,7 +26,7 @@ class ErrorBoundary extends Component<Props, State> {
2626
});
2727
}
2828

29-
public render(): ReactNode {
29+
public render(): ReactElement {
3030
const { hasError, error } = this.state;
3131
const { children } = this.props;
3232
const isDevelopment = process.env.NODE_ENV === 'development';

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,7 +2710,7 @@ __metadata:
27102710
"@react-spring/types": ^9.2.4
27112711
"@testing-library/dom": ^8.6.0
27122712
"@testing-library/jest-dom": ^5.14.1
2713-
"@testing-library/react": ^12.1.0
2713+
"@testing-library/react": ^12.1.1
27142714
"@testing-library/react-hooks": ^7.0.2
27152715
"@testing-library/user-event": ^13.2.1
27162716
"@types/jest": ^27.0.2
@@ -2949,16 +2949,16 @@ __metadata:
29492949
languageName: node
29502950
linkType: hard
29512951

2952-
"@testing-library/react@npm:^12.1.0":
2953-
version: 12.1.0
2954-
resolution: "@testing-library/react@npm:12.1.0"
2952+
"@testing-library/react@npm:^12.1.1":
2953+
version: 12.1.1
2954+
resolution: "@testing-library/react@npm:12.1.1"
29552955
dependencies:
29562956
"@babel/runtime": ^7.12.5
29572957
"@testing-library/dom": ^8.0.0
29582958
peerDependencies:
29592959
react: "*"
29602960
react-dom: "*"
2961-
checksum: 84ab074f12dbea82e5b08b976a6471c3a7d71629c72c895b661a2652d2b136cbc3de91f7152ca9e1485255c54f39acfa2ff2982ac20f94cf63f5eb84319c56d5
2961+
checksum: 1882161426854801a9e5b00c6e50e76b813c22158c8a45c36b87d0aeab4d6ce0920387f8f738562bb693ec217a5885641ef82f0a135cddcde870edda097f2ebb
29622962
languageName: node
29632963
linkType: hard
29642964

0 commit comments

Comments
 (0)