Checking `prop in elem` fails with deferred custom element definitions
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 38.9k
- Forks
- 2.3k
- Avg merge
- 20h 18m
- Merged PRs (30d)
- 35
Description
Reproduction: https://www.webpackbin.com/bins/-KikMSw9W7D7EHbuTdTX
Context: Skate is using Preact under the hood to render, so h is just a straight export of Preact's h in that bin. val is a function that ensures props are explicitly set all of the time. Another way to work around the check here would be to use a ref and imperatively set the prop.
I spoke with @developit and the proposed solution is to always set props for anything that isn't a string or number, while continuing the prop in elem check. However, I'm not sure the in check is still necessary after implementing something like this.
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 WebpackBin reproduction and inspect the Preact h call involved in handling props for a deferred custom element. Compare the behavior with the proposed rule for non-string and non-number props; done means the reproduction works without requiring an imperative ref and the need for the prop in elem check is resolved.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100