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

Preparing React Accessible Accordion for React 18 #341

Closed
holloway opened this issue Dec 10, 2021 · 5 comments
Closed

Preparing React Accessible Accordion for React 18 #341

holloway opened this issue Dec 10, 2021 · 5 comments

Comments

@holloway
Copy link

It seems that broadly speaking it will be compatible, but our generated ids will have to use the useId hook,

it's even more important in React 18 because of how our streaming server renderer delivers HTML out-of-order. Solutions that may have worked previously, like using a counter to generate IDs, don't work in 18.0 because you can't rely on a consistent sequence. (cite)

We were using the counter to generate IDs approach, so we'll have to adopt useId.

Because we have React as a peerDep we'll have to detect if useId is available and fallback to our existing counter approach.

As such these autogenerated ids will change in a release of RAA for React 18.

Are there any other issues that we should address for React 18?

@trigunam
Copy link

We are also looking for React 18 support for accordions. @holloway is there a plan to merge this PR #342?

@holloway
Copy link
Author

@trigunam yes, within a week if testing goes well.

@holloway
Copy link
Author

@trigunam This has been published as 5.0.0. Please let me know if this works for you.

@trigunam
Copy link

It's working now. Thank you @holloway

@holloway
Copy link
Author

Great, thanks!

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

2 participants