From 97db203f2c4c05a43095a064155b978d6a20899b Mon Sep 17 00:00:00 2001 From: Josh Story Date: Thu, 5 Oct 2023 08:21:03 -0700 Subject: [PATCH] experimental prefixes were temporarily restored but were still missing from the server rendering stub. This adds them back in. --- packages/react-dom/server-rendering-stub.js | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/react-dom/server-rendering-stub.js b/packages/react-dom/server-rendering-stub.js index bb6dbd1813ac6..b2e88599718a1 100644 --- a/packages/react-dom/server-rendering-stub.js +++ b/packages/react-dom/server-rendering-stub.js @@ -28,3 +28,30 @@ export { useFormState, unstable_batchedUpdates, } from './src/server/ReactDOMServerRenderingStub'; + +import type {FormStatus} from 'react-dom-bindings/src/shared/ReactDOMFormActions'; +import {useFormStatus, useFormState} from './src/client/ReactDOM'; + +export function experimental_useFormStatus(): FormStatus { + if (__DEV__) { + console.error( + 'useFormStatus is now in canary. Remove the experimental_ prefix. ' + + 'The prefixed alias will be removed in an upcoming release.', + ); + } + return useFormStatus(); +} + +export function experimental_useFormState( + action: (S, P) => Promise, + initialState: S, + permalink?: string, +): [S, (P) => void] { + if (__DEV__) { + console.error( + 'useFormState is now in canary. Remove the experimental_ prefix. ' + + 'The prefixed alias will be removed in an upcoming release.', + ); + } + return useFormState(action, initialState, permalink); +}