Add support for multiple roots with useId
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 38.9k
- Forks
- 2.4k
- Avg merge
- 20h 18m
- Merged PRs (30d)
- 35
Description
- Check if updating to the latest Preact version resolves the issue
Describe the bug
There may be clashes in ids with multiple roots in the same page. This is a follow-up issue to #3772 . See: https://github.com/preactjs/preact/issues/3772#issuecomment-1291460015
To Reproduce
https://codesandbox.io/s/preact-useid-multiple-y0qbwq?file=/src/index.js
Expected behavior
What should have happened when following the steps above?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox reproduction and the discussion in issue #3772, especially the referenced comment. Trace how useId behaves when multiple roots are rendered on the same page; done means the reproduced roots no longer generate clashing IDs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100