As a non-TS developer, I'm delving into the realm of multiple selects and dropdown menus with Material-UI's select component. Progressing from a basic setup, I successfully implemented a single select but now face a challenge in adding another dropdown using the onChange event.
type OnChangeValue = {
locationNaming: unknown;
departmentNaming?: unknown;
};
...
export const ServerNamingDropdown: React.FC<ServerNamingDropdownProps> = ({
onChange,
error,
initialValue = undefined,
}) => {
const [locationNamingSelected, setLocationNaming] = useState(
initialValue ? initialValue : '',
);
...
I need to incorporate a new dropdown for Department which means tweaking the OnChangeValue interface to include 'departmentNaming'. However, I'm struggling to grasp how to handle the onChange function effectively for this additional dropdown field.
If you have any insights or suggestions on how to tackle this issue, I would greatly appreciate your input. Thank you!