Closed premu21 closed 4 years ago
Error while I add few more columns and when I define their onclick function, it goes into a loop for setstate and hence doesn't work.
Following is my code in render return method:
<ReactFlexyTable data={seeks} additionalCols={this.additionalCols} sortable globalSearch />
Following function was created in the render method, and then moved to class. Still no difference.
additionalCols = [ { header: "Actions", td: (data) => { return ( <Button onClick={this.handleShow(data)} style={{ padding: "0.5rem 0.7rem" }} > <i className="fa fa fa-eye m-auto" aria-hidden="true" style={{ fontSize: "0.9rem" }} ></i> </Button> ); }, }, ];
Any help would be appreciated.
maybe you should use arrow function
<Button onClick={()=>this.handleShow(data)} style={{ padding: "0.5rem 0.7rem" }} >
Error while I add few more columns and when I define their onclick function, it goes into a loop for setstate and hence doesn't work.
Following is my code in render return method:
Following function was created in the render method, and then moved to class. Still no difference.
Any help would be appreciated.