const handleClick = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, children: ReactNode): void => {
if (children) {
const {current}: HTMLUListElement = children;
if (current) {
current.scrollTop = list.current.scrollHeight;
}
}
}
setTimeout(() => handleClick(e, props.children), 0);
сыпится ошибка на
current:
TS2322: Type 'string | number | true | {} | ReactElement ReactElement Component)> | null) | (new (props: any) => Component<...>)> | ReactNodeArray | ReactPortal' is not assignable to type 'HTMLUListElement'. Type 'string' is not assignable to type 'HTMLUListElement'.
TS2339: Property 'current' does not exist on type 'HTMLUListElement'.
не понимаю как задать current значение HTMLUListElement