When rendering a component in React (with many subcomponents) and a JS error is thrown for whatever reason, what\'s the best way to handle this? Sure I can catch the error
For React v16 and up, the recommended way is to use error boundaries. This page (short and good)from the React team explains the feature:
https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html. It includes a link to a codepen demo as well.