Skip to content

Commit 99e46eb

Browse files
authored
feat: supporting react 18 (#99)
* feat: supporting react 18 * ci: install testing-library/react for react 18
1 parent df8f262 commit 99e46eb

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,35 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
node-version:
11-
- 14
12-
- 16
13-
- 18
14-
react: [16, 17]
10+
node: [14, 16, 18]
11+
react: [16, 17, 18]
1512

16-
name: build (${{ matrix.node-version }} w/ React ${{ matrix.react }}
13+
name: build (${{ matrix.node }} w/ React ${{ matrix.react }}
1714

1815
steps:
1916
- uses: actions/checkout@v3
2017

21-
- name: Use Node.js ${{ matrix.node-version }}
18+
- name: Use Node.js ${{ matrix.node }}
2219
uses: actions/setup-node@v3
2320
with:
24-
node-version: ${{ matrix.node-version }}
21+
node-version: ${{ matrix.node }}
2522

2623
# Node 14 ships with npm@6 which doesn't install peerDeps by default.
2724
- name: Install npm@7
28-
if: matrix.node-version == '14'
25+
if: matrix.node == '14'
2926
run: npm install -g npm@7
3027

3128
- name: Install deps
3229
run: npm ci
3330

34-
- name: Install React 16
35-
if: matrix.react == '16'
31+
- name: Install React ${{ matrix.react }}
3632
run: npm i react@${{ matrix.react }} react-dom@${{ matrix.react }}
3733

34+
# `@testing-library/react@13` dropped support for React 16 and 17 so to ensure that we run
35+
# fine under React 18 we should upgrade it if we're testing React 18.
36+
- name: Install testing-library react for React 18
37+
if: matrix.react == '18'
38+
run: npm i @testing-library/react@13
39+
3840
- name: Run tests
3941
run: npm test

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"prop-types": "^15.8.1"
2828
},
2929
"peerDependencies": {
30-
"react": "16.x || 17.x",
31-
"react-dom": "16.x || 17.x"
30+
"react": "16.x || 17.x || 18.x",
31+
"react-dom": "16.x || 17.x || 18.x"
3232
},
3333
"devDependencies": {
3434
"@babel/preset-env": "^7.16.11",

0 commit comments

Comments
 (0)