constChild = function () { return<div> ... </div>; }; exportdefaultfunctionDemo() { const box = useRef(null); useEffect(() => { console.log(box.current); //null // Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? }, []); return ( <div> <Childref={box} /> </div> ); }