Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 453 Bytes

ReactJS-Maximum-update-depth-exceeded-error.md

File metadata and controls

19 lines (12 loc) · 453 Bytes

ReactJS: Maximum update depth exceeded error

Cause: hat because you calling toggle inside the render method which will cause to re-render and toggle will call again and re-rendering again and so on

Change

{<td><span onClick={this.toggle()}>Details</span></td>}

To

{<td><span onClick={this.toggle}>Details</span></td>}

Reference

https://stackoverflow.com/a/48497410