import React, { useEffect, useRef, useState } from "react"; import classnames from "classnames"; import "./index.scss"; import useOutsideClick from "../../../_helpers/customHook/useOutsideClick"; import { PresentToAllSharp } from "@material-ui/icons"; // interface Props { // value: OptionInputRadio; // setValue: (..._args: any[]) => void; // label: string; // className?: string; // options: OptionInputRadio[]; // inputEditable?: boolean; // placeholder: string; // isWarning?: boolean; // setIsWarning?: (..._args: any[]) => void; // disabledClick?: boolean; // } const InputRadio = (props) => { const [isOpen, setIsOpen] = useState(false); const $selectRef = useRef(null); const isOpenCached = useRef(null); useEffect(() => { isOpenCached.current = isOpen; }, [isOpen]); useOutsideClick($selectRef, () => { if (isOpenCached.current) { setIsOpen(false); } }); // console.log(props.value); return (