Skip to content
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

Add React 19 Support #231

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

justinwinslow
Copy link

Bumped versions and fixed appropriate tests. I think the revisions to the tests were necessarily mostly due to: https://react.dev/blog/2024/04/25/react-19-upgrade-guide#strict-mode-improvements

Take a look, though, and let me know if I missed anything.

@albertogasparin
Copy link
Collaborator

That's cool. I'd love however to find a way to run both 18 and 19, as I worry something might be different and most of the consumers are still on v18 🤔

@justinwinslow
Copy link
Author

justinwinslow commented Jan 10, 2025

We could do something like:

const version = +React.version.split('.')[0];
if (version > 18) {
  expect(selector).toHaveBeenCalledTimes(2);
} else {
  expect(selector).toHaveBeenCalledTimes(withStrict(2));
}

We could add the version check to utils so it's abstracted a little. Ideally we could add the version check into withStrict but it's used elsewhere validly so it's not clear to me if there's a straightforward way to make that work.

Also, in case it's not clear, everything seems to work fine between 18 and 19 - it's just the tests that needed to be tweaked.

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

Successfully merging this pull request may close these issues.

2 participants