Re:Error Handling in React 16
by mattashii on Thursday July 27, 2017 @03:37AM
(#14863358)
When a component throws, it means the user's code has encountered an unexpected error. That means the component is in an unexpected state, and you cannot reasonably say that that component can rebuild it's (internal) state to a stable (and renderable) state.
[ Parent
| on HN ]
but in theory at that point in the operation, we're still in the process of building a new DOM (hence the old DOM is still around)? So you could replace the component with an error node and during the diffing process replace with the old node?
Not great but if you hit a fatal error you hit a fatal error
Re:Error Handling in React 16
by beaconstudios on Thursday July 27, 2017 @05:46AM
(#14863821)
personally I would rather a website tell me that an error occurred using the new mechanism than fall back to a previous version of the DOM and have me wondering why clicking that button isn't doing anything.