Skip to content

Commit 47b27fa

Browse files
authored
fix: update to React 18 (#223)
1 parent a8d358c commit 47b27fa

File tree

5 files changed

+30
-31
lines changed

5 files changed

+30
-31
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@tsconfig/node14": "^14.1.2",
5858
"@types/jest": "^29.0.0",
5959
"@types/node": "^14.0.0",
60-
"@types/react": "^17.0.39",
60+
"@types/react": "^18.0.0",
6161
"@typescript-eslint/eslint-plugin": "^5.0.0",
6262
"@typescript-eslint/parser": "^5.0.0",
6363
"@vercel/ncc": "^0.38.0",
@@ -76,7 +76,7 @@
7676
"jest-util": "^29.0.2",
7777
"lint-staged": "^13.0.0",
7878
"prettier": "^3.0.0",
79-
"react": "^17.0.2",
79+
"react": "^18.0.0",
8080
"semantic-release": "^23.0.0",
8181
"slash": "^3.0.0",
8282
"ts-jest": "^29.0.0",

src/PostMessage.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { testPathPatternToRegExp } from 'jest-util';
55
import * as React from 'react';
66
import { Box, Text } from 'ink';
77

8-
const LeftPadded: React.FC = ({ children }) => (
8+
const LeftPadded: React.FC<{ children: React.ReactNode }> = ({ children }) => (
99
<Box paddingLeft={1}>{children}</Box>
1010
);
1111

12-
const HorizontallyPadded: React.FC = ({ children }) => (
13-
<Box paddingX={1}>{children}</Box>
14-
);
12+
const HorizontallyPadded: React.FC<{ children: React.ReactNode }> = ({
13+
children,
14+
}) => <Box paddingX={1}>{children}</Box>;
1515

1616
const TestInfo: React.FC<{ config: Config.GlobalConfig }> = ({ config }) => {
1717
if (config.runTestsByPath) {

src/SnapshotStatus.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,28 @@ import { Box, Text } from 'ink';
66
import { pluralize } from 'jest-util';
77
import { Arrow, Dot } from './shared';
88

9-
const FailText: React.FC = ({ children }) => (
9+
const FailText: React.FC<{ children: React.ReactNode }> = ({ children }) => (
1010
<Text bold color="red">
1111
{children}
1212
</Text>
1313
);
14-
const SnapshotAdded: React.FC = ({ children }) => (
14+
const SnapshotAdded: React.FC<{ children: React.ReactNode }> = ({
15+
children,
16+
}) => (
1517
<Text bold color="green">
1618
{children}
1719
</Text>
1820
);
19-
const SnapshotUpdated: React.FC = ({ children }) => (
21+
const SnapshotUpdated: React.FC<{ children: React.ReactNode }> = ({
22+
children,
23+
}) => (
2024
<Text bold color="green">
2125
{children}
2226
</Text>
2327
);
24-
const SnapshotOutdated: React.FC = ({ children }) => (
28+
const SnapshotOutdated: React.FC<{ children: React.ReactNode }> = ({
29+
children,
30+
}) => (
2531
<Text bold color="yellow">
2632
{children}
2733
</Text>

src/Summary.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ import { useCounter } from './hooks';
77

88
const PROGRESS_BAR_WIDTH = 40;
99

10-
const SummaryHeading: React.FC = ({ children }) => (
10+
const SummaryHeading: React.FC<{ children: string }> = ({ children }) => (
1111
<Box width={13}>
1212
<Text bold>{children}:</Text>
1313
</Box>
1414
);
1515

16-
const RightPaddedWithComma: React.FC = ({ children }) => (
16+
const RightPaddedWithComma: React.FC<{ children: React.ReactNode }> = ({
17+
children,
18+
}) => (
1719
<Box paddingRight={1}>
1820
<Text>{children},</Text>
1921
</Box>

yarn.lock

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,21 +1780,13 @@ __metadata:
17801780
languageName: node
17811781
linkType: hard
17821782

1783-
"@types/react@npm:^17.0.39":
1784-
version: 17.0.80
1785-
resolution: "@types/react@npm:17.0.80"
1783+
"@types/react@npm:^18.0.0":
1784+
version: 18.3.2
1785+
resolution: "@types/react@npm:18.3.2"
17861786
dependencies:
17871787
"@types/prop-types": "*"
1788-
"@types/scheduler": ^0.16
17891788
csstype: ^3.0.2
1790-
checksum: 1c27bfc42305d77ef0da55f8f6d4c4a3471aa02b294fcf29ea0f2cfb0bf02892e5a0a3bc7559fa4a5ba50697b2e31076cb5aa5987f69cfc2e880f6426edb8bdf
1791-
languageName: node
1792-
linkType: hard
1793-
1794-
"@types/scheduler@npm:^0.16":
1795-
version: 0.16.8
1796-
resolution: "@types/scheduler@npm:0.16.8"
1797-
checksum: 6c091b096daa490093bf30dd7947cd28e5b2cd612ec93448432b33f724b162587fed9309a0acc104d97b69b1d49a0f3fc755a62282054d62975d53d7fd13472d
1789+
checksum: d0b8b9d0ede6cd28dbbe34106d914b5e3652d9d7aa9d0f32fe6171506b6fc7c826d9d6571642976a5422bd29c5022fd893a710ed59a1177a0c1df8e02cf17ffe
17981790
languageName: node
17991791
linkType: hard
18001792

@@ -5601,7 +5593,7 @@ __metadata:
56015593
"@tsconfig/node14": ^14.1.2
56025594
"@types/jest": ^29.0.0
56035595
"@types/node": ^14.0.0
5604-
"@types/react": ^17.0.39
5596+
"@types/react": ^18.0.0
56055597
"@typescript-eslint/eslint-plugin": ^5.0.0
56065598
"@typescript-eslint/parser": ^5.0.0
56075599
"@vercel/ncc": ^0.38.0
@@ -5620,7 +5612,7 @@ __metadata:
56205612
jest-util: ^29.0.2
56215613
lint-staged: ^13.0.0
56225614
prettier: ^3.0.0
5623-
react: ^17.0.2
5615+
react: ^18.0.0
56245616
semantic-release: ^23.0.0
56255617
slash: ^3.0.0
56265618
ts-jest: ^29.0.0
@@ -7782,13 +7774,12 @@ __metadata:
77827774
languageName: node
77837775
linkType: hard
77847776

7785-
"react@npm:^17.0.2":
7786-
version: 17.0.2
7787-
resolution: "react@npm:17.0.2"
7777+
"react@npm:^18.0.0":
7778+
version: 18.3.1
7779+
resolution: "react@npm:18.3.1"
77887780
dependencies:
77897781
loose-envify: ^1.1.0
7790-
object-assign: ^4.1.1
7791-
checksum: b254cc17ce3011788330f7bbf383ab653c6848902d7936a87b09d835d091e3f295f7e9dd1597c6daac5dc80f90e778c8230218ba8ad599f74adcc11e33b9d61b
7782+
checksum: a27bcfa8ff7c15a1e50244ad0d0c1cb2ad4375eeffefd266a64889beea6f6b64c4966c9b37d14ee32d6c9fcd5aa6ba183b6988167ab4d127d13e7cb5b386a376
77927783
languageName: node
77937784
linkType: hard
77947785

0 commit comments

Comments
 (0)