3 ms·
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 reason
by mattashii 9y ago
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.
- rtpg 9y agobut 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
- beaconstudios 9y agopersonally 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.