Please don't use unnecessary plugins just to avoid writing class components. Writing a single ErrorBoundary class component and wrapping that in a functional HOC is easy and lightweight enough, and allows you much more flexibility in rendering and hooking into the error-capturing code. It also lets you reuse the error boundary visual components outside of explicit React error propagation.
Please don't use unnecessary plugins just to avoid writing class components. Writing a single ErrorBoundary class component and wrapping that in a functional HOC is easy and lightweight enough, and allows you much more flexibility in rendering and hooking into the error-capturing code. It also lets you reuse the error boundary visual components outside of explicit React error propagation.
Thanks FJones for the feedback!
Would be great if you can provide a codepen for it.