react-testing-library icon indicating copy to clipboard operation
react-testing-library copied to clipboard

Does not work with React 17 - Readme implies works for 16+

Open oehm-smith opened this issue 3 years ago • 3 comments

I have a react17 project. Installation results in peerDependency error. The latest version (v13.3.0)'s package.json contains

    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  },

You need to update the doco to help those not on 18.

v12.1.5 specifies:

    "react": "*",
    "react-dom": "*"
  }

Which seems to be what I need. But if not (or if so) you need to make this clear.

Good work otherwise! :)

oehm-smith avatar Aug 19 '22 02:08 oehm-smith

13.x does work with the versions specified in peerDependencies. The warning is correct. You need to switch to 12.x.

Readme implies works for 16+

Could you point to the part of the documentation that implies that to you?

eps1lon avatar Aug 19 '22 06:08 eps1lon

https://github.com/testing-library/react-testing-library#suppressing-unnecessary-warnings-on-react-dom-168 says:

Suppressing unnecessary warnings on React DOM 16.8

There is a known compatibility issue with React DOM 16.8 where you will see the following warning:

oehm-smith avatar Aug 19 '22 08:08 oehm-smith

PR's are welcome for this if anyone wants to fix it in the README and state that version >=13 requires React >=18.

MatanBobi avatar Sep 12 '22 06:09 MatanBobi