Skip to content

Commit

Permalink
fix(ErrorBoundary-types): change children type to ReactElement
Browse files Browse the repository at this point in the history
`@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
  • Loading branch information
sabertazimi committed Oct 1, 2021
1 parent 1b0400f commit 5420890
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -50,7 +50,7 @@
"@react-spring/types": "^9.2.4",
"@testing-library/dom": "^8.6.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.1.0",
"@testing-library/react": "^12.1.1",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.2",
Expand Down
6 changes: 3 additions & 3 deletions src/components/ErrorBoundary/ErrorBoundary.tsx
@@ -1,8 +1,8 @@
import { Result, Typography } from 'antd';
import React, { Component, ErrorInfo, ReactNode } from 'react';
import React, { Component, ErrorInfo, ReactElement } from 'react';

interface Props {
children: ReactNode;
children: ReactElement;
}

interface State {
Expand All @@ -26,7 +26,7 @@ class ErrorBoundary extends Component<Props, State> {
});
}

public render(): ReactNode {
public render(): ReactElement {
const { hasError, error } = this.state;
const { children } = this.props;
const isDevelopment = process.env.NODE_ENV === 'development';
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Expand Up @@ -2710,7 +2710,7 @@ __metadata:
"@react-spring/types": ^9.2.4
"@testing-library/dom": ^8.6.0
"@testing-library/jest-dom": ^5.14.1
"@testing-library/react": ^12.1.0
"@testing-library/react": ^12.1.1
"@testing-library/react-hooks": ^7.0.2
"@testing-library/user-event": ^13.2.1
"@types/jest": ^27.0.2
Expand Down Expand Up @@ -2949,16 +2949,16 @@ __metadata:
languageName: node
linkType: hard

"@testing-library/react@npm:^12.1.0":
version: 12.1.0
resolution: "@testing-library/react@npm:12.1.0"
"@testing-library/react@npm:^12.1.1":
version: 12.1.1
resolution: "@testing-library/react@npm:12.1.1"
dependencies:
"@babel/runtime": ^7.12.5
"@testing-library/dom": ^8.0.0
peerDependencies:
react: "*"
react-dom: "*"
checksum: 84ab074f12dbea82e5b08b976a6471c3a7d71629c72c895b661a2652d2b136cbc3de91f7152ca9e1485255c54f39acfa2ff2982ac20f94cf63f5eb84319c56d5
checksum: 1882161426854801a9e5b00c6e50e76b813c22158c8a45c36b87d0aeab4d6ce0920387f8f738562bb693ec217a5885641ef82f0a135cddcde870edda097f2ebb
languageName: node
linkType: hard

Expand Down

0 comments on commit 5420890

Please sign in to comment.