You should pass a function reference to requestAnimationFrame
, not invoke the function:
requestAnimationFrame(this.render);
Since you're using this
inside render
, you'll probably need bind
:
requestAnimationFrame(this.render.bind(this));
Your version is causing a Stack Overflow (the function is calling itself synchronously, until the call stack is full).