react-component / react-component/select

Almost ineffective useMemo?

Open
#669 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
938
Forks
482
Avg merge
15h 8m
Merged PRs (30d)
2

Description

Hi everyone, I saw a useMemo with children props as its dependency, but react renews children references in every render, so is this useMemo used just to prevent rerender caused by internal state changes? I mean whenever the parent component re-renders, Select re-renders too, it's a little strange

https://github.com/react-component/select/blob/95aa5b937b871c8eac0283d62d14d9b6c6acadac/src/generate.tsx#L454

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

Start at src/generate.tsx#L454 and inspect the useMemo dependency involving children. Trace how Select renders during parent and internal state updates, then determine with maintainers whether the memoization should be changed or retained and document the expected rendering behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.