Ama*_*mar 6 javascript jsx typescript reactjs tsx
我需要组件的引用.刚刚从jsx转移到tsx,无法找到解决此问题的方法.
其他解决方法是使用查询选择器,但这并不是我认为做出反应的好方法.
这是构造函数
constructor(props) {
super(props);
this.state = {
data: initialData,
showNewListForm: false,
whichButtonClicked: undefined,
background: props.background || "#23719f"
};
this.divContainerRef = React.createRef();
console.log("kanban reference : " + React.createRef().current);
this.handleDragStart = this.handleDragStart.bind(this);
this.handleDragEnd = this.handleDragEnd.bind(this);
this.handleLaneDragEnd = this.handleLaneDragEnd.bind(this);
this.handleLaneDragStart = this.handleLaneDragStart.bind(this);
this.onCardAdd = this.onCardAdd.bind(this);
this.onCardClick = this.onCardClick.bind(this);
this.addNewListHandler = this.addNewListHandler.bind(this);
this.containerRefResolver = this.containerRefResolver.bind(this);
this.isBoardPresent = this.isBoardPresent.bind(this);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3550 次 |
| 最近记录: |