import * as React from 'react'; import { useRef, useEffect } from 'react'; import { Button } from '../../Button'; interface IDropdownOptionProps { selectedOption: any; setDropdownValue: (option: any, index: number) => void; option: any; focus: boolean; index: number; handleKeyDown: (event: any) => void; } export const DropdownOption = (props: IDropdownOptionProps) => { const { selectedOption, setDropdownValue, option, focus, handleKeyDown, index } = props; const { value, label } = option; const ref = useRef(null); useEffect(() => { if (focus && ref.current) ref.current.focus(); }, [focus]); return ( ); };