I need the reference of the component. Just shifted from jsx to tsx and can't find a solution for this problem.
Other workaround would be to use query selector but that's not a good way of doing things in react I believe.
Here is the constructor function
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);
}
React
correctly? – Undamped