File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -28,3 +28,30 @@ export {
28
28
useFormState ,
29
29
unstable_batchedUpdates ,
30
30
} 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
+ }
You can’t perform that action at this time.
0 commit comments