react hook:useRef,forwardRef, useImperativeHandle父子通信

文章浏览阅读128次,点赞4次,收藏4次。点击Father.tsx里的按钮就可以调用子组件里的方法了。使用场景:父组件调用子组件里的方法。子组件:Children.tsx。父组件:Father.tsx。