We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5facfa7 commit fbf0057Copy full SHA for fbf0057
src/components/shared/select/Select.tsx
@@ -25,13 +25,11 @@ export const Select = ({
25
placeholder = 'Select an option',
26
disabled = false,
27
}: SelectProps): JSX.Element => {
28
- const [selectedLabel, setSelectedLabel] = useState(
29
- options.find(option => option.value === value)?.label || ''
30
- )
+ const selectedOption = options.find(option => option.value === value)
+ const selectedLabel = selectedOption?.label || ''
31
32
- const handleSelect = (value: string, label: string) => {
+ const handleSelect = (value: string) => {
33
onChange(value)
34
- setSelectedLabel(label)
35
}
36
37
const triggerStyle = clsx({
0 commit comments