JavaScript/react/React.RefObject

来自康健生活

引言

React.createRef 创建的类型,只读不可改。

示例

示例一

  ...
  dateWrap: React.RefObject<HTMLDivElement>;
  constructor(props: DateProps){
    super(props)
    this.dateWrap= React.createRef();
    this.state = {
       ...
    }
  }
...

error