I'm wondering if it is possible to add animated components and custom components simultaneously in a components prop inside a Select component.
Couldn't find anything in the react-select documentation, unfortunately.
With "animated components" I'm referring to these: https://react-select.com/home#animated-components.
"Custom components" would be these: https://react-select.com/components#replaceable-components
In my case the custom component would be this one:
// Custom component
const CustomMultiValue = (
props: MultiValueProps<FilterOptions, GroupTypeBase<FilterOptions>>
) => (
<components.MultiValue {...props}>{props.data.label}</components.MultiValue>
);
// Animated components
const animatedComponents = makeAnimated();
The Select looks like this:
<Select
isMulti
onChange={(value) => handleChange(value)}
styles={customSelectStyles}
components={{ MultiValue: CustomMultiValue }}
theme={customSelectTheme}
closeMenuOnSelect={false}
placeholder={placeholder}
/>
I've tried a bunch of ways to add the animatedComponents, but nothing seems to work. For example:
components={animatedComponents, { MultiValue: CustomMultiValue }}
components={{ MultiValue: CustomMultiValue, Control: animatedComponents }}
Anyone got an idea? Thanks!