react-checkbox-tree
react-checkbox-tree copied to clipboard
Support for React 18.0
The current dependency on react supports react@"^15.3.0 || ^16.0.0 || ^17.0.0"
. React 18.0.0 was released on March 29, 2022, and that version should be added to the set of supported versions to allow installing this package with the new React version.
This is definitely a goal.
The release of React 18 and still lack of an official Enzyme adapter for React 17 makes it more likely we need to switch to a different testing suite, which brings its own challenges. I could also simply add v18 to the package.json
, but there is no guarantee the library would work.
Hi. Does this mean we cannot expect this project to be compatible with React 18 in a while? I just need to plan ahead :)
@tbjerknes Unfortunately, yes. Do not expect compatibility for a while.
in case somebody stucked use npm i --legacy-peer-deps
lib works fine on react@18 for me
FWIW, we use React 18 and enzyme and haven't seen any issues other than this benign output:
console.error
Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot
at printWarning (node_modules/react-dom/cjs/react-dom.development.js:86:30)
at error (node_modules/react-dom/cjs/react-dom.development.js:60:7)
at Object.render (node_modules/react-dom/cjs/react-dom.development.js:29670:5)
at fn (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/ReactSeventeenAdapter.js:435:26)
at node_modules/@wojtekmaj/enzyme-adapter-react-17/src/ReactSeventeenAdapter.js:351:17
at Object.act (node_modules/react/cjs/react.development.js:2512:16)
at wrapAct (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/ReactSeventeenAdapter.js:350:13)
at Object.render (node_modules/@wojtekmaj/enzyme-adapter-react-17/src/ReactSeventeenAdapter.js:421:16)
...we also use this package and haven't seen any issues with react 18 either. I would vote to add it to the package.json :)
Also in my application I don't seem to have any issue, just as a feedback on this topic.
Added React 18 to the peer dependency list in v1.8.0.
From surface level testing, React 18 appears to works fine. However, due to Enzyme not supporting React 18, the automated tests do not cover it. Replacing Enzyme with React Testing Library is an arduous affair that I don't have the stamina for just yet. Therefore, I decided to just create a new release with tentative support for React 18.