react-component / react-component/util
Improve pickAttrs
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 670
- Forks
- 205
- Avg merge
- 11d 17h
- Merged PRs (30d)
- 4
Description
This is useful for filter out react unknown props then safely pass to dom element.
styled-components/utils/validAttr.js is a good example.
Use {}.hasOwnProperty replace Array.indexOf. It's boost more than 10x faster.
Contributor guide
No contributing guide indexed for this repository
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
Locate the pickAttrs entry point and any tests covering filtering of React props. Read the referenced styled-components/utils/validAttr.js example, then compare the current Array.indexOf behavior with the requested property lookup. Done means unknown props remain filtered safely for DOM elements and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100