Skip to content

Commit

Permalink
actually test with react 18
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Jun 30, 2021
1 parent 08f69bd commit ab29f79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Install React ${{matrix.react-version}}
if: matrix.react-version != '17.x'
run: |
npm install --save-dev \
npm install --force --save-dev \
react@${{matrix.react-version}} \
react-dom@${{matrix.react-version}} \
react-test-renderer@${{matrix.react-version}}
Expand Down
6 changes: 5 additions & 1 deletion test/util/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ async function render(initialProps) {

const div = env.document.createElement('div');
const container = new Promise((resolve) => {
ReactDOM.render(<Container {...initialProps} ref={resolve} />, div);
if (ReactDOM.version.startsWith('18')) {
ReactDOM.createRoot(div).render(<Container {...initialProps} ref={resolve} />);
} else {
ReactDOM.render(<Container {...initialProps} ref={resolve} />, div);
}
});
await readyPromise;

Expand Down

0 comments on commit ab29f79

Please sign in to comment.