react-component / react-component/util

Improve pickAttrs

Open
#13 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.