Skip to content

类组件 ​

类组件三大特性:

  • state
  • props
  • context

类组件点击事件:

prop-types: 限制props类型

ref ​

ref三种写法:

  • 字符串
  • 回调函数
  • createRef