This repository was archived by the owner on Jan 13, 2026. It is now read-only.
Merged
Conversation
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
absoludity
approved these changes
Sep 10, 2021
Contributor
absoludity
left a comment
There was a problem hiding this comment.
CI is happy. I'm happy :)
|
|
||
| mount(<TestComponent />); | ||
| expect(Object.keys(listeners).length).toBe(1); | ||
| expect(Object.keys(listeners).length).toBe(2); |
Contributor
Author
There was a problem hiding this comment.
I'm not 100% sure, but it has something to do with the changes in the event delegation [1], but I just manually confirmed the hook was working as expected (that is, clicking outside the context switcher and right menu is working as expected), but I performed this change for the tests to pass.
[1] https://reactjs.org/blog/2020/10/20/react-v17.html#changes-to-event-delegation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
This PR simply upgrades the react version from 16 to 17, which is mostly an internal refactor with no new features (they will add them in React 18 instead).
In fact, they say:
However, the enzyme adaptor we are using for the tests has to be updated accordingly (see drawbacks).
Benefits
We will be ready for the upcoming react versions.
Possible drawbacks
There is no official enzyme adapter yet (although there is an open PR enzymejs/enzyme#2430). In the meanwhile, there is an unofficial module published that is working (working=our tests are passing, since enzyme is just for testing) (more info enzymejs/enzyme#2429 (comment))
Applicable issues
N/A
Additional information
There is no reason to merge this PR now, as it is just an update I wanted to perform some time ago, but, as I said, no new features so far. We can hold it until we release 2.4.1, for instance. Up to you, I don't foresee any errors, but let's see what our beloved CI thinks.