Don't reset work loop until stack is unwound
When replaying a suspended function components, we want to reuse the hooks that were computed during the original render. Currently we reset the state of the hooks right after the component suspends (or throws an error). This is too early because it doesn't give us an opportunity to wait for the promise to resolve. This refactors the work loop to reset the hooks right before unwinding instead of right after throwing. It doesn't include any other changes yet, so there should be no observable behavioral change.
A
Andrew Clark committed
4a2d86bddbcef3e64bc404302cdbd9638af8801b
Parent: 9dfbd9f