import classNames from "classnames"; import React, { useRef } from "react"; interface Props { children?: React.ReactElement; onClick?: () => void; className?: string; } const Backdrop = ({ children, onClick, className }: Props) => { const ref = useRef(null); const handleClick = (e: React.MouseEvent) => { if (e.target != ref.current || !onClick) { return; } onClick(); }; return (
{children}
); }; export default Backdrop;