// App.js import React, { useRef } from "react"; import Child from "./Child"; export default function App() { const childRef = useRef(); return ( { childRef.current.showAlert(); }} > 버튼 눌러 ); } // Child.js import React, { forwardRef, useImperativeHandle } from "react"; const Child = forwardRef((props, ref) => { useImperativeHandle(ref, () => ({ showAlert() { alert("hi"); } })); return 자식임; }); e..