import {useRef} from 'react'; import './dropdown.css'; type ItemClick = (e: MouseEvent) => void; const Dropdown = (title: string, list: Array<{ title: string, onClick: ItemClick }>) => { const ulRef = useRef(null); const onMouseMove = () => { if (ulRef.current == null) { return; } ulRef.current.style.display = 'block'; } const onMouseOut = () => { if (ulRef.current == null) { return; } ulRef.current.style.display = 'none'; } const items = list.map(item =>
  • {item.title}
  • ) return (
    {title}
    ); } export default Dropdown;