Skip to content

Preparing React Accessible Accordion for React 18 #341

@holloway

Description

@holloway

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions