React-select is slow when you have more than 1000 items
See original GitHub issueLow performance on large sets of options
React-select slows down when you have a huge array of data. Mouse
FPS drops so low on mouseover, that i can barely use it. In my real case, where i have 1010 items, which i need to show(and i can’t load them as user types) - i cannot do anything at all.
You can find a simple example in codesandbox.
https://codesandbox.io/s/q8l6xnvz7w
[Violation] 'mouseover' handler took 346ms
[Violation] 'mouseover' handler took 184ms
[Violation] 'mouseover' handler took 197ms
[Violation] 'mouseover' handler took 172ms
[Violation] 'mouseover' handler took 161ms
[Violation] 'mouseover' handler took 150ms
[Violation] 'mouseover' handler took 167ms
[Violation] 'mouseover' handler took 172ms
[Violation] 'mouseover' handler took 156ms
[Violation] 'mouseover' handler took 166ms
React-select version: 2.1.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:99
- Comments:82 (1 by maintainers)
Top Results From Across the Web
Optimize your react-select component to smoothly ... - Botsplash
React -select is one of the most popular libraries for dropdown components. It offers solid rendering and filtering for hundreds of options, ...
Read more >Efficiently rendering large list of data in React Select
I would implement lazy loading and add to the dropdown when user scroll to the bottom of the dropdown. React will only render...
Read more >Improve the performance of dropdown containing large data ...
Now, let us consider a dropdown that has more than 1000+ options to be loaded. Loading complete data at once. import React, {...
Read more >Optimize your react-select component to smoothly ... - Medium
React -select is one of the most popular libraries for dropdown ... or so items, you can start to feel a bit of...
Read more >Rendering large lists in React: 5 methods with examples
Lists are an integral part of most web applications because they help ... of data that's causing the lag, but the rendered DOM...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Two things to look into that may help with your issues, we also had some issues regarding large lists.
filterOption={createFilter({ignoreAccents: false})}
Take a look at this reported bug https://github.com/JedWatson/react-select/issues/2850
There’s two examples using React-Window, which greatly improves the performance.
https://codesandbox.io/s/lxv7omv65l
If it’s the typing lag that you’re bumping on (I was) then it’s actually the
filterOption={createFilter({ignoreAccents: false})}
suggestion by @M1K3Yio that’s the gem.Using this massively reduces the lag when you’re typing into the select. I’ve got a sandbox here that illustrates: https://codesandbox.io/s/zn70lqp31m?fontsize=14
And I’ve blogged it too