Skip to content

Make it much more prominent that only >= react@16.9.0 is supported #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sgb-io opened this issue Sep 27, 2019 · 4 comments
Closed

Make it much more prominent that only >= react@16.9.0 is supported #183

sgb-io opened this issue Sep 27, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@sgb-io
Copy link

sgb-io commented Sep 27, 2019

Right now, this is mentioned like a footnote in the readme. I invested time to write tests on parts of our app using hooks, only to later discover that even with a quite modern version of React (16.8.6), the tests work, but the peer dependency requirement means I get two versions of React and therefore my types collide.

I think it would be courteous to make this more prominent at the top of the README.

@sgb-io sgb-io added the enhancement New feature or request label Sep 27, 2019
@mpeyper
Copy link
Member

mpeyper commented Sep 27, 2019

Hi @sgb-io,

Sorry if you lost any time with this. PRs are always welcome for improving the documentation.

I haven't yet seen the peer dependency be an issue for people. In fact, I didn't think it would cause a duplicate version issue at all as the whole point of a peer dependency is that the user must install the dependency themselves and you just get install time warnings about versions mismatches.

You mentioned your types colliding, so this sounds more like the existing issue around how to deal with type dependencies, #110. If that's the case, I think we can close this issue and keep track of it in that one.

@sgb-io
Copy link
Author

sgb-io commented Sep 30, 2019

Thanks @mpeyper, I think relocating the types is the right solution. The current collision problem means that effectively only 16.9.0+ is supported (for TypeScript users), but it sounds like your suggestion in #110 could solve the problem and therefore make more versions compatible for TypeScript users.

@sgb-io sgb-io closed this as completed Sep 30, 2019
@sgb-io
Copy link
Author

sgb-io commented Sep 30, 2019

Actually, I realised that the dependency on React 16.9.0 is a hard one, since you're using act. Therefore this could still be a documentation improvement.

@sgb-io sgb-io reopened this Sep 30, 2019
@mpeyper mpeyper closed this as completed in 13c9fcd Oct 3, 2019
@mpeyper
Copy link
Member

mpeyper commented Oct 3, 2019

I've tried to make it stand out in the docs a bit more:

  • README
  • Installation Docs
  • NPM page
  • NPM CLI
    > npm i react@16.8.6 react-test-renderer@16.8.6 @testing-library/react-hooks
    npm WARN @testing-library/react-hooks@2.0.3 requires a peer of react@>=16.9.0 but none is installed. You must install peer dependencies yourself.
    npm WARN @testing-library/react-hooks@2.0.3 requires a peer of react-test-renderer@>=16.9.0 but none is installed. You must install peer dependencies yourself.
    
    + react@16.8.6
    + react-test-renderer@16.8.6
    + @testing-library/react-hooks@2.0.3
    added 16 packages from 32 contributors and audited 36 packages in 4.588s
    found 0 vulnerabilities

Happy to accept PRs to improve this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants