tajo / react-range

🎚️Range input with a slider. Accessible. Bring your own styles and markup.
https://react-range.pages.dev
MIT License
847 stars 97 forks source link

Don't create markRefs unless renderMarks is provided #178

Closed wolfd closed 2 years ago

wolfd commented 2 years ago

We have an application that uses react-range under the hood, and we noticed that a range input was taking 2GB of RAM on our machines. I did some investigation and found that regardless of whether the marks functionality was being used, refs were being created for each possible value of the range.

We have some fairly huge ranges (we're using the input to scrub a video with potential microsecond accuracy), and can imagine that other people are affected by the existing behavior. This change should allow us to continue using large input ranges (without marks) without incurring a memory penalty.

Fixes #170