JedWatson / JedWatson/react-select

Select is slow to render with many selected options

Open
#5,514 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue/bug-unconfirmed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

React select is slow to render and slows down other UI elements if it has many selected options.

Reproduction:

  1. https://codesandbox.io/s/react-select-v5-sandbox-forked-b9dgvl?file=/example.js
  2. If you toggle "Toggle other content" button, div appears ant disappears fast.
  3. Clicking "Toggle select" already renders slow when Select appears.
  4. Now clicking on "Toggle other content" is also slow.
  5. You can observe it getting faster/slower depending on items count by changing ITEM_COUNT in code

Of course 5000 is not what real world app would have, but it emphasizes how long multiple renders can take.

Contributor guide

Open the contributing guide

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 by running the linked CodeSandbox reproduction and inspect example.js, especially the render behavior with different ITEM_COUNT values. Compare the Toggle select and Toggle other content interactions before and after the change; done means rendering remains responsive with many selected options.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.