react/packages/react-native-renderer/src
Andrew Clark 540bab085d
Implement experimental_useFormStatus (#26722)
This hook reads the status of its ancestor form component, if it exists.

```js
const {pending, data, action, method} = useFormStatus();
```

It can be used to implement a loading indicator, for example. You can
think of it as a shortcut for implementing a loading state with the
useTransition hook.

For now, it's only available in the experimental channel. We'll share
docs once its closer to being stable. There are additional APIs that
will ship alongside it.

Internally it's implemented using startTransition + a context object.
That's a good way to think about its behavior, but the actual
implementation details may change in the future.

Because form elements cannot be nested, the implementation in the
reconciler does not bother to keep track of multiple nested "transition
providers". So although it's implemented using generic Fiber config
methods, it does currently make some assumptions based on React DOM's
requirements.
2023-04-26 18:19:58 -04:00
..
__mocks__/react-native/Libraries/ReactPrivate Implement public instances for text nodes in Fabric (#26516) 2023-04-04 14:43:35 +01:00
__tests__ Implement public instances for text nodes in Fabric (#26516) 2023-04-04 14:43:35 +01:00
legacy-events [flow] make Flow suppressions explicit on the error (#26487) 2023-03-27 13:43:04 +02:00
server Implement experimental_useFormStatus (#26722) 2023-04-26 18:19:58 -04:00
NativeMethodsMixinUtils.js Refactor ReactFabricHostComponent (#26323) 2023-03-07 14:33:55 +00:00
ReactFabric.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFabricComponentTree.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFabricEventEmitter.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactFabricGlobalResponderHandler.js Restore some guards in ReactFabricGlobalResponderHandler after refactor (#26394) 2023-03-15 10:30:40 +00:00
ReactFabricInjection.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactFiberConfigFabric.js Implement experimental_useFormStatus (#26722) 2023-04-26 18:19:58 -04:00
ReactFiberConfigNative.js Implement experimental_useFormStatus (#26722) 2023-04-26 18:19:58 -04:00
ReactNativeAttributePayload.js [flow] make Flow suppressions explicit on the error (#26487) 2023-03-27 13:43:04 +02:00
ReactNativeBridgeEventPlugin.js [flow] make Flow suppressions explicit on the error (#26487) 2023-03-27 13:43:04 +02:00
ReactNativeComponentTree.js Fix use of stale props in Fabric events (#26408) 2023-03-17 11:27:49 +00:00
ReactNativeEventEmitter.js [flow] make Flow suppressions explicit on the error (#26487) 2023-03-27 13:43:04 +02:00
ReactNativeEventPluginOrder.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactNativeFiberHostComponent.js Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592) 2023-04-10 14:58:44 -07:00
ReactNativeFiberInspector.js Remove ReactFabricPublicInstance and used definition from ReactNativePrivateInterface (#26437) 2023-03-22 17:54:36 +00:00
ReactNativeGetListener.js Removed unused imperative events implementation from React Native renderer (#26282) 2023-03-02 15:54:51 +00:00
ReactNativeGlobalResponderHandler.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
ReactNativeInjection.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactNativeInjectionShared.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
ReactNativePublicCompat.js Remove ReactFabricPublicInstance and used definition from ReactNativePrivateInterface (#26437) 2023-03-22 17:54:36 +00:00
ReactNativeRenderer.js [flow] make Flow suppressions explicit on the error (#26487) 2023-03-27 13:43:04 +02:00
ReactNativeTypes.js Implement public instances for text nodes in Fabric (#26516) 2023-04-04 14:43:35 +01:00