Closed joverlee521 closed 2 years ago
From memory (I can't find the branch / stash anymore) getting styled components to work with react select was difficult. That was a long time ago, so things may have improved.
This may also fix #1453 out of the box?
Since we are upgrading, I thought we should just upgrade to the latest version (5.2.2). Starting with v5, they have converted to TypeScript and they explicitly state that they have dropped support for Internet Explorer 11. I don't think this is a deal breaker for us, but wanted to mention here in case anyone else thinks we should stick with v4.
Turns out the the upgrade from v1 is pretty straightforward (see upgrade-react-select
branch).
The bigger hurdle is actually replacing react-virtualized-select
since it is built on top of react-select
v1 and also no longer maintained.
A few options forward:
react-select
components, maybe react-select-virtualized?react-virtualized
to build our own custom MenuList
to use with Select
.
There are examples of this in https://github.com/JedWatson/react-select/issues/3128
(We can then use CellMeasurer
from react-virtualized
to make the options height dynamic.)Option 1 seems like the easiest change now, but options 2 & 3 would allow us to tackle #1453.
P.S. f9944eb7eda30c5922d229fafe2752f21fa507b4 is the commit which introduced react-virtualized-select
. I would suggest options 2 or 3, so that we can address #1453.
We are still using v1 of
react-select
which is no longer maintained. We should upgrade the package to use new features that have been added, such as option groups. The latest version is v5, but v2 was a complete rewrite so we should follow their v2 upgrade guide to make the necessary changes.According to @jameshadfield: