Skip to content

Commit

Permalink
feat: support react 18 (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
redonkulus authored Apr 25, 2023
1 parent ff1b985 commit eef5d53
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
legacy-peer-deps = true
package-lock = false
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@babel/preset-env": "^7.9.6",
"@babel/preset-react": "^7.9.4",
"@babel/register": "^7.9.0",
"@testing-library/react": "^12.0.0",
"@testing-library/react": "^14.0.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^9.0.1",
"babel-plugin-dynamic-import-node": "^2.2.0",
Expand Down Expand Up @@ -73,8 +73,8 @@
"pre-commit": "^1.0.0",
"prettier": "^2.0.5",
"promise": "^8.0.2",
"react": "^16.8.3 || ^17.0.0",
"react-dom": "^16.8.3 || ^17.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"webpack": "^5.64.4",
"webpack-dev-server": "^4.0.0",
"xunit-file": "^2.0.0"
Expand All @@ -86,8 +86,8 @@
"instrumentation"
],
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"precommit": [
"lint",
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* global window */
import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';

import {
createI13nNode,
Expand All @@ -24,6 +25,7 @@ if (!Object.assign) {

window.React = React;
window.ReactDOM = ReactDOM;
window.createRoot = createRoot;

window.I13nAnchor = I13nAnchor;
window.I13nButton = I13nButton;
Expand Down
7 changes: 5 additions & 2 deletions tests/functional/i13n-functional.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global document, React, ReactDOM */
/* global document, React, ReactDOM, createRoot */
function getJsonFromUrl() {
const query = location.search.substr(1);
const result = {};
Expand Down Expand Up @@ -251,7 +251,10 @@ try {
},
[testPlugin]
);
const Demo = ReactDOM.render(<I13nDemo />, container);
// const Demo = ReactDOM.render(<I13nDemo />, container);

const root = createRoot(container);
root.render(<I13nDemo />);
} catch (e) {
alert(e);
}

0 comments on commit eef5d53

Please sign in to comment.