ReactJS Maximum update depth exceeded.

Sami C.
1 min readJan 15, 2019

--

To fix this error I had to change my onClick event from

onClick={this.play()}

To

onClick={this.play}

Found out that the first snippet was calling the play() function inside the render method which will re-render again causing an infinite loop.

Cheers!

--

--

Sami C.
Sami C.

Written by Sami C.

Freelance Software Engineer

No responses yet