Skip to content

Commit

Permalink
experimental prefixes were temporarily restored but were still missin…
Browse files Browse the repository at this point in the history
…g from the server rendering stub. This adds them back in.
  • Loading branch information
gnoff committed Oct 5, 2023
1 parent 16619f1 commit 97db203
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/react-dom/server-rendering-stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<S, P>(
action: (S, P) => Promise<S>,
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);
}

0 comments on commit 97db203

Please sign in to comment.