Preact toChildArray does not assign keys
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 38.9k
- Forks
- 2.4k
- Avg merge
- 20h 18m
- Merged PRs (30d)
- 35
Description
Reproduction
https://fanatical-dot-bumper.glitch.me/
In React documentation, they say
That is, toArray prefixes each key in the returned array so that each element’s key is scoped to the input array containing it.
In other words, it will assign keys, even if they were undefined before. This is not the case for Preact's implementation and causes issues when using preact/compat
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 Glitch reproduction and trace Preact's toChildArray behavior, especially through preact/compat. Compare the returned elements with the React documentation's stated key behavior; done means previously undefined keys are assigned consistently and the reported compatibility issue no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100