Add React 19 Support
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.
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 🤔
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.