Skip to content

Support for React 17 #2429

Description

@layershifter

An RC for React 17 was released: https://reactjs.org/blog/2020/08/10/react-v17-rc.html

And it does not work with React 17, oops:
image

Working on an isolated repro ✍️

Activity

  1. layershifter commented on Aug 11, 2020

    @layershifter
    Author

    A CodeSandbox is ready: https://codesandbox.io/s/cranky-euclid-4qr9z
    It's enough to use mount(<div />) to repro it, see index.test.js.

  2. ljharb commented on Aug 11, 2020

    @ljharb
    Member

    I would never expect enzyme to "just work" with a new major version of React out of the box :-) React breaks things in minors often enough as it is.

    First, I have to create an adapter for React 17, and then we'll be able to look at the test failures and go from there.

  3. layershifter commented on Aug 12, 2020

    @layershifter
    Author

    @ljharb I started #2430 as I would like to run tests on React 17 ASAP 😺 Appreciate your eyes on it

  4. self-assigned this
    on Aug 12, 2020
  5. ljharb commented on Aug 12, 2020

    @ljharb
    Member

    Thanks, but that isn't going to speed anything up. enzyme won't be guaranteed to work on React 17 until it's fully released, not a preview.

  6. wojtekmaj commented on Aug 18, 2020

    @wojtekmaj

    I think no one expects everything to work right from the start, but it would be nice to just have the adapter preview so we can find bugs early :)

  7. ljharb commented on Aug 18, 2020

    @ljharb
    Member

    That is certainly my hope and plan, just not something i can commit to, since the react team hasn’t coordinated with me prior to releases in years.

  8. gaearon commented on Aug 19, 2020

    @gaearon
    Contributor

    It’s fair we haven’t reached out before this particular RC since we generally view an RC as a “reachout” to the whole community. But I believe I did file #2358 (16.14 compatibility). Our plans for 16.14 changed and that release turned into 17 but I’d expect the naming change described in that issue to be the primary one you’d need to address. (Although I could totally be missing something!) Sorry for the frustration.

  9. ljharb commented on Aug 19, 2020

    @ljharb
    Member

    @gaearon fair point that there's been nonzero efforts, primarily from you personally, which I appreciate. Thanks for pointing me to that issue; I'll incorporate that into the update.

  10. wojtekmaj commented on Aug 24, 2020

    @wojtekmaj

    For those impatient ones (myself included), I published @wojtekmaj/enzyme-adapter-react-17 package. It's exactly like enzyme-adapter-react-16, just the necessary bits replaced.

    Use it like any other adapter, so:

    import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
    
    enzyme.configure({ adapter: new Adapter() });

    I tested it on a semi large repository (2000 tests) with no failures, so it should be good enough to use, if the only thing blocking you was a broken adapter.

    I will deprecate the package once an official adapter is released. lol

    Enjoy!

  11. trigunam commented on Sep 23, 2020

    @trigunam
  12. ljharb commented on Sep 23, 2020

    @ljharb
  13. hengkx commented on Oct 21, 2020

    @hengkx

    react 17 has been released.

  14. ljharb commented on Oct 21, 2020

    @ljharb
    Member

    Indeed it has, thanks. I'm still working on getting the adapter set up and passing tests.

  15. 100 remaining items

  16. ljharb commented on Jan 19, 2022

    @ljharb
  17. added a commit that references this issue on Mar 26, 2022
  18. JWBrownie commented on Jul 18, 2023

    @JWBrownie
  19. ljharb commented on Jul 18, 2023

    @ljharb
  20. VictorQueiroz commented on Jul 18, 2023

    @VictorQueiroz
  21. ljharb commented on Jul 18, 2023

    @ljharb
  22. aaryn101 commented on Jul 18, 2023

    @aaryn101
  23. ljharb commented on Jul 19, 2023

    @ljharb
  24. sbaechler commented on Jul 19, 2023

    @sbaechler
  25. hoangph271 commented on Jul 19, 2023

    @hoangph271
  26. ljharb commented on Jul 19, 2023

    @ljharb
  27. VictorQueiroz commented on Jul 19, 2023

    @VictorQueiroz
  28. aaryn101 commented on Jul 19, 2023

    @aaryn101
  29. ljharb commented on Jul 19, 2023

    @ljharb
  30. locked as off topic and limited conversation to collaborators on Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions