Add error boundary to Flight fixture#26695
Conversation
|
Comparing: fd3fb8e...9cfd696 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
sebmarkbage
left a comment
There was a problem hiding this comment.
Also use it for src/Button.js?
| <ErrorBoundary> | ||
| <form | ||
| action={async formData => { | ||
| setIsPending(true); |
There was a problem hiding this comment.
Does this even work now given that this whole thing should be a transition now?
There was a problem hiding this comment.
Ah yeah I guess it doesn't. I could wrap it in flushSync temporarily. Or maybe just wait to update the fixture until I add useFormPending.
There was a problem hiding this comment.
OTOH that behavior is broken anyway. So I'l do the flushSync for now, with a TODO explaining it's temporary.
There was a problem hiding this comment.
The isPending state is dead code anyways. I think it's copy & paste from the button example where it controlled the disabled state.
There was a problem hiding this comment.
I think it's just there to illustrate what the pattern is. Everything resolves so fast anyway you don't notice in the button example either.
There was a problem hiding this comment.
Yeah, when I introduced it in https://github.com/facebook/react/pull/26293/files there was a delay of 500ms in the action. 🤷
Errors in form actions are now rethrown during render (facebook#26689), so we can handle the using an error boundary.
8aa62c4 to
9cfd696
Compare
Errors in form actions are now rethrown during render (#26689), so we can handle them using an error boundary.
Errors in form actions are now rethrown during render (facebook#26689), so we can handle them using an error boundary.
Errors in form actions are now rethrown during render (#26689), so we can handle them using an error boundary.