The reactJS class should receive a proper error handler
The ReactJS library is displaying the exception message and dying in case an exception happens while executing JS. this is a very bad behavior for an integration inside Symfony/Twig (it is a bad default behavior altogether IMO as it makes things harder to integrate all the time). I suggest either changing the default behavior in the library (not catching exception but letting them go out of the class and be handled through the normal exception handling of PHP) or providing a way to change the exception handling in the bundle (and the clean way would probably be to do the same).
I agree, especially when the javascript is executed before adjusting the error handler. Letting the exception to be catched by PHP system seems the right way to do. But i don't have enough experience to say if i have to implement an interface inside my bundle or contribute to the original library. What do you think about it @stof ?
@qpautrat I suggest fixing it in the original library (i.e. removing the default behavior of killing the process on exceptions).