diff --git a/src/components/order-form/form/car-body/car-body-select.tsx b/src/components/order-form/form/car-body/car-body-select.tsx index 309958f..ddc873f 100644 --- a/src/components/order-form/form/car-body/car-body-select.tsx +++ b/src/components/order-form/form/car-body/car-body-select.tsx @@ -18,7 +18,9 @@ import { CarBodySelectOption } from './types'; export const CarBodySelect = forwardRef( function CarBodySelect(props, ref) { - const [selected, setSelected] = useState>({}); + const initialOption = carBodySelectOptions.find(({ value }) => value === Number(props.value)); + const [selected, setSelected] = useState>(initialOption); + const handleOptionClick = (option: CarBodySelectOption) => { setSelected(option); // eslint-disable-next-line @typescript-eslint/ban-ts-comment