I am trying to style my react select component in my typescript react app without success. When following the docs: https://react-select.com/styles#provided-styles-and-state, I get the following error:
No overload matches this call.
Overload 1 of 2, '(props: Readonly<ReactSelectProps<string>>): ReactSelectClass<string>', gave the following error.
Type '{ control: () => { width: number; }; }' has no properties in common with type 'CSSProperties'.
Overload 2 of 2, '(props: ReactSelectProps<string>, context?: any): ReactSelectClass<string>', gave the following error.
Type '{ control: () => { width: number; }; }' has no properties in common with type 'CSSProperties'. TS2769
Code example:
const inputStyle = {
control: () => ({
width: 200,
}),
<Select
name="Name"
options={options}
style={inputStyle}
/>
Anyone knows how to use custom styling with typescript and react select? Thanks.