reagent-project / reagent

A minimalistic ClojureScript interface to React.js
http://reagent-project.github.io/
MIT License
4.76k stars 414 forks source link

Investigate if Reagent should stop logging render errors #531

Closed Deraen closed 3 years ago

Deraen commented 3 years ago

https://github.com/reagent-project/reagent/blob/4f40516b0b1e90aac7b35800b34c769f48986ac6/src/reagent/impl/component.cljs#L115-L128

React already logs the errors (in some cases?), so Reagent is just adding duplicate information to console currently.

In one current project I'm seeing two "Error rendering component" log messages from Reagent, original Error, and a log message from React. If this works similarly in other cases, this error logging could be removed from Reagent.

Previously I think Reagent added component stack information, but it is now included in all errors / added by React.

Deraen commented 3 years ago

This was probably changed in React 16, and React should now log all render errors: https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html#component-stack-traces