Limenius / ReactRenderer

Client and Server-side React rendering from PHP
MIT License
237 stars 37 forks source link

Add timerPolyfills to PhpExecJsReactRenderer #5

Closed teameh closed 7 years ago

teameh commented 7 years ago

This will make sure php won't throw an error with:

An exception has been thrown during the rendering of a template ("V8Js::compileString():52234: ReferenceError: setTimeout is not defined").

But instead the component will render and the user will see this in the console:

image

See https://github.com/shakacode/react_on_rails/blob/master/lib/react_on_rails/server_rendering_pool/exec.rb#L114-L150 for original code in React on Rails repo