-
|
At first I didn't make any error handling, when something occurs, the app stucks. I found |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I probably recommend using |
Beta Was this translation helpful? Give feedback.
I probably recommend using
ErrorBoundaryif it fits your use case since it handles unmounting of children. It usesonErrorinternally but the benefit ofErrorBoundaryis it ensures children are all resolved up to that point. WithonErrorit is possible for children contexts to get passed out of the creator upwards and escape it.onErroris the lower level primitive and is ok generally higher up in the render tree for logging things butErrorBoundaryis more suited for managing the view. I mostly provideonErrorin case someone wishes to implement their ownErrorBoundarydifferent than I have created.