摘要:
const giftsMapRef = useRef({}) const giftRef = (ele:HTMLElement, giftId:number) =>{ giftsMapRef.current['gift-'+giftId] = ele; } <div className='gift- 阅读全文
posted @ 2022-06-29 15:33
奔跑的太阳花
阅读(1391)
评论(0)
推荐(0)
摘要:
目录 一、类组件的情况下 1、定义父组件(直接使用ref) export default class UserRef1 extends Component { constructor(props) { super(props); this.child = React.createRef(); } f 阅读全文
posted @ 2022-06-29 15:14
奔跑的太阳花
阅读(9372)
评论(0)
推荐(0)