react/packages/react-reconciler/src
Andrew Clark fd3fb8e3c5
Rethrow errors from form actions (#26689)
This is the next step toward full support for async form actions.

Errors thrown inside form actions should cause the form to re-render and
throw the error so it can be captured by an error boundary. The behavior
is the same if the `<form />` had an internal useTransition hook, which
is pretty much exactly how we implement it, too.

The first time an action is called, the form's HostComponent is
"upgraded" to become stateful, by lazily mounting a list of hooks. The
rest of the implementation for function components can be shared.

Because the error handling behavior added in this commit is just using
useTransition under-the-hood, it also handles pending states, too.
However, this pending state can't be observed until we add a new hook
for that purpose. I'll add this next.
2023-04-21 13:29:46 -04:00
..
__mocks__/scheduler [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
__tests__ [Float][Fiber] Enable Float methods to be called outside of render (#26557) 2023-04-20 14:40:25 -07:00
forks [Float][Fiber] Enable Float methods to be called outside of render (#26557) 2023-04-20 14:40:25 -07:00
DebugTracing.js [flow] make Flow suppressions explicit on the error (#26487) 2023-03-27 13:43:04 +02:00
MaxInts.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactCapturedValue.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactChildFiber.js [flow] make Flow suppressions explicit on the error (#26487) 2023-03-27 13:43:04 +02:00
ReactCurrentFiber.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactEventPriorities.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
ReactFiber.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberAct.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberAsyncAction.js Initial (client-only) async actions support (#26621) 2023-04-19 13:33:11 -04:00
ReactFiberBeginWork.js Rethrow errors from form actions (#26689) 2023-04-21 13:29:46 -04:00
ReactFiberCache.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
ReactFiberCacheComponent.js [flow] enable enforce_local_inference_annotations (#25921) 2023-01-09 15:46:48 -05:00
ReactFiberClassComponent.js Delete unused `eventTimes` Fiber field (#26599) 2023-04-11 08:23:04 -04:00
ReactFiberClassUpdateQueue.js Upgrade Flow to 0.201 (#26326) 2023-03-06 10:33:22 -05:00
ReactFiberCommitWork.js Delete unused `eventTimes` Fiber field (#26599) 2023-04-11 08:23:04 -04:00
ReactFiberCompleteWork.js Diff properties in the commit phase instead of generating an update payload (#26583) 2023-04-10 19:09:28 -04:00
ReactFiberComponentStack.js Model Float on Hoistables semantics (#26106) 2023-02-09 22:59:29 -08:00
ReactFiberConcurrentUpdates.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
ReactFiberConfig.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberConfigWithNoHydration.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberConfigWithNoMicrotasks.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberConfigWithNoMutation.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberConfigWithNoPersistence.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberConfigWithNoResources.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberConfigWithNoScopes.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberConfigWithNoSingletons.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberConfigWithNoTestSelectors.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberContext.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
ReactFiberDevToolsHook.js SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
ReactFiberErrorDialog.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactFiberErrorLogger.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactFiberFlags.js Suspensily committing a prerendered tree (#26434) 2023-03-26 23:48:37 -04:00
ReactFiberHiddenContext.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
ReactFiberHooks.js Rethrow errors from form actions (#26689) 2023-04-21 13:29:46 -04:00
ReactFiberHostContext.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberHotReloading.js Delete unused `eventTimes` Fiber field (#26599) 2023-04-11 08:23:04 -04:00
ReactFiberHydrationContext.js Diff properties in the commit phase instead of generating an update payload (#26583) 2023-04-10 19:09:28 -04:00
ReactFiberLane.js Delete unused `eventTimes` Fiber field (#26599) 2023-04-11 08:23:04 -04:00
ReactFiberLazyComponent.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
ReactFiberNewContext.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberOffscreenComponent.js Feature: Suspend commit without blocking render (#26398) 2023-03-17 18:05:11 -04:00
ReactFiberReconciler.js Rethrow errors from form actions (#26689) 2023-04-21 13:29:46 -04:00
ReactFiberRoot.js Delete unused `eventTimes` Fiber field (#26599) 2023-04-11 08:23:04 -04:00
ReactFiberRootScheduler.js Initial (client-only) async actions support (#26621) 2023-04-19 13:33:11 -04:00
ReactFiberScope.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberShellHydration.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
ReactFiberStack.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
ReactFiberSuspenseComponent.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberSuspenseContext.js Bugfix: SuspenseList incorrectly forces a fallback (#26453) 2023-03-22 13:33:02 -04:00
ReactFiberThenable.js Check if suspensey instance resolves in immediate task (#26427) 2023-03-20 12:35:10 -04:00
ReactFiberThrow.js Remove no-fallthrough lint suppressions (#26553) 2023-04-04 20:08:33 -07:00
ReactFiberTracingMarkerComponent.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
ReactFiberTransition.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberTreeContext.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
ReactFiberTreeReflection.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFiberUnwindWork.js Model Float on Hoistables semantics (#26106) 2023-02-09 22:59:29 -08:00
ReactFiberWorkLoop.js Rethrow errors from form actions (#26689) 2023-04-21 13:29:46 -04:00
ReactHookEffectTags.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactInternalTypes.js Delete unused `eventTimes` Fiber field (#26599) 2023-04-11 08:23:04 -04:00
ReactMutableSource.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactPortal.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactPostPaintCallback.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactProfilerTimer.js [flow] enable LTI inference mode (#26104) 2023-02-09 17:07:39 -05:00
ReactReconcilerConstants.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
ReactRootTags.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactStrictModeWarnings.js [flow] enable LTI inference mode (#26104) 2023-02-09 17:07:39 -05:00
ReactTestSelectors.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactTypeOfMode.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactWorkTags.js Model Float on Hoistables semantics (#26106) 2023-02-09 22:59:29 -08:00
Scheduler.js SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
clz32.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
getComponentNameFromFiber.js Model Float on Hoistables semantics (#26106) 2023-02-09 22:59:29 -08:00