forwardRef 來獲取傳遞到它身上的 ref ,然後再傳遞到它render 的DOM button 上:. const FancyButton = React.forwardRef((props, ref) => ( <button ref={ref} ...
確定! 回上一頁