I am using react-select to show a list of users in a dropdown. I want it to always show the selected element as the first element in the list. Is there native support for this?
Example:
In the following image, since Green is selected, I want Green to appear at the top of the list before Ocean

You can pass an initialize callback to
useStateto sort theoptionsarray for the first time and put thedefaultValueon top: