Interact with the component to see it in action
undefinedCopy and paste this code into your project
import { Select } from 'thereactselect';
import { useState } from 'react';
const options = [
{ value: "apple", label: "Apple" },
{ value: "banana", label: "Banana" },
{ value: "orange", label: "Orange" },
{ value: "grape", label: "Grape" },
{ value: "strawberry", label: "Strawberry" },
{ value: "watermelon", label: "Watermelon" },
];
function MyComponent() {
const [value, setValue] = useState<string | number | undefined>(undefined);
return (
<Select
options={options}
value={value}
onValueChange={setValue}
/>
);
}