react-checkbox-tree icon indicating copy to clipboard operation
react-checkbox-tree copied to clipboard

Support for React 18.0

Open BenjaminStuermer opened this issue 2 years ago • 5 comments

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.

BenjaminStuermer avatar Mar 31 '22 09:03 BenjaminStuermer

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.

jakezatecky avatar Apr 01 '22 20:04 jakezatecky

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 avatar May 23 '22 12:05 tbjerknes

@tbjerknes Unfortunately, yes. Do not expect compatibility for a while.

jakezatecky avatar May 23 '22 14:05 jakezatecky

in case somebody stucked use npm i --legacy-peer-deps lib works fine on react@18 for me

Ciberusps avatar Jul 13 '22 16:07 Ciberusps

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 :)

ldeveber avatar Aug 03 '22 14:08 ldeveber

Also in my application I don't seem to have any issue, just as a feedback on this topic.

SergioArrighi avatar Aug 09 '22 08:08 SergioArrighi

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.

jakezatecky avatar Sep 06 '22 19:09 jakezatecky