HOC for Suspense and ErrorBoundary
I was wondering whether it's possible to have following component:
and use it without having to pass the children as function. If I try to do pass children as a JSX element, both Suspense and ErrorBoundary arent used at all.
2 Replies
If I try to do pass children as a JSX element, both Suspense and ErrorBoundary arent used at allThat's because you're destructuring props, which causes
children to be evaulated before ErrorBoundary and Suspense are created. Avoid destructuring and children as a JSX element should work fineThank you very much!