3 ms·
Everyone with a legacy codebase will probably update their components to extend a common class that handles errors in some very generic way without propagating
by raquo 9y ago
Everyone with a legacy codebase will probably update their components to extend a common class that handles errors in some very generic way without propagating them up the tree.
I'm not sure how I feel about this change, but at least there's an escape hatch.
- superplussed 9y agoDo you mean wrapping all components with a HOC?
- raquo 9y agoNo, I mean ES6 class inheritance: class MyButton extends MyBaseComponent { // Render a button } Class MyBaseComponent extends React.Component { // Include error handling lifecycle hook here }