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

React 19 support #20

Closed
bmv437 opened this issue Jan 15, 2025 · 8 comments
Closed

React 19 support #20

bmv437 opened this issue Jan 15, 2025 · 8 comments

Comments

@bmv437
Copy link

bmv437 commented Jan 15, 2025

Hi there. I noticed when attempting to upgrade to React 19 that the functionality of react-keyed-flatten-children stopped working.

I've forked the codesandbox example in the README and upgraded it to React 19 as a reproduction:
https://codesandbox.io/p/sandbox/react-keyed-flatten-children-example-forked-tq55fj

Are there any plans for this package to support React 19?

@alfonsusac
Copy link

I've tested Children.forEach with React 19 but not with this library.

The problem lies with how async components are handled in Children array methods

It seems that even though based on the source code async components are handled it doesn't seem to work in practice.

Passing a promised component into Children array methods will hang the entire browser.

@grrowl
Copy link
Owner

grrowl commented Jan 19, 2025

Tracked it down to facebook/react#31688react-is needs to be >=19 to work with React 19. I'll ship an update to react-keyed-flatten-children today :)

Thanks for the great report!

@grrowl
Copy link
Owner

grrowl commented Jan 19, 2025

Here's a fork of the codesandbox with the correct behaviour https://codesandbox.io/p/sandbox/react-keyed-flatten-children-example-forked-tq55fj

@grrowl
Copy link
Owner

grrowl commented Jan 19, 2025

Fixed in #21 and v3.1.0 — we maintain existing React 15+ support at runtime, and this upgrades our test suite to React 19. Thanks again!

@grrowl grrowl closed this as completed Jan 19, 2025
@bmv437
Copy link
Author

bmv437 commented Jan 21, 2025

Thanks @grrowl for getting this fix out, and super happy to see it maintains backward compatibility!

@benface
Copy link

benface commented Jan 21, 2025

I agree, thank you so much for the amazing work on this library, both @grrowl and @bmv437. Unfortunately, it looks like there is a backward compatibility issue with this change, I filed an issue at #22. No big deal, I will pin my version to 3.0.2 for now, and maybe I'll have time to look into it if nobody does first. Thanks again!

@grrowl
Copy link
Owner

grrowl commented Jan 25, 2025

Ah my apologies @benface can you confirm which version of React you're seeing this in? Ideal would be a codesandbox reproduction of the issue, I will have time to look into this Monday 🤞

@benface
Copy link

benface commented Jan 25, 2025

Hey, still on React 18 here. I will try to reproduce in CodeSandbox soon and will update the issue when I have done so. Thank you!

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

No branches or pull requests

4 participants