Skip to content

Commit 97db203

Browse files
committed
experimental prefixes were temporarily restored but were still missing from the server rendering stub. This adds them back in.
1 parent 16619f1 commit 97db203

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

packages/react-dom/server-rendering-stub.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,30 @@ export {
2828
useFormState,
2929
unstable_batchedUpdates,
3030
} from './src/server/ReactDOMServerRenderingStub';
31+
32+
import type {FormStatus} from 'react-dom-bindings/src/shared/ReactDOMFormActions';
33+
import {useFormStatus, useFormState} from './src/client/ReactDOM';
34+
35+
export function experimental_useFormStatus(): FormStatus {
36+
if (__DEV__) {
37+
console.error(
38+
'useFormStatus is now in canary. Remove the experimental_ prefix. ' +
39+
'The prefixed alias will be removed in an upcoming release.',
40+
);
41+
}
42+
return useFormStatus();
43+
}
44+
45+
export function experimental_useFormState<S, P>(
46+
action: (S, P) => Promise<S>,
47+
initialState: S,
48+
permalink?: string,
49+
): [S, (P) => void] {
50+
if (__DEV__) {
51+
console.error(
52+
'useFormState is now in canary. Remove the experimental_ prefix. ' +
53+
'The prefixed alias will be removed in an upcoming release.',
54+
);
55+
}
56+
return useFormState(action, initialState, permalink);
57+
}

0 commit comments

Comments
 (0)