1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  *
    
  7.  * @flow
    
  8.  */
    
  9. 
    
  10. // Export all exports so that they're available in tests.
    
  11. // We can't use export * from in Flow for some reason.
    
  12. 
    
  13. import ReactVersion from 'shared/ReactVersion';
    
  14. export {ReactVersion as version};
    
  15. 
    
  16. export {default as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED} from './src/ReactDOMSharedInternals';
    
  17. 
    
  18. export {
    
  19.   createPortal,
    
  20.   flushSync,
    
  21.   prefetchDNS,
    
  22.   preconnect,
    
  23.   preload,
    
  24.   preloadModule,
    
  25.   preinit,
    
  26.   preinitModule,
    
  27.   useFormStatus,
    
  28.   useFormState,
    
  29.   unstable_batchedUpdates,
    
  30. } from './src/server/ReactDOMServerRenderingStub';
    
  31. 
    
  32. import type {FormStatus} from 'react-dom-bindings/src/shared/ReactDOMFormActions';
    
  33. import {
    
  34.   useFormStatus,
    
  35.   useFormState,
    
  36. } from './src/server/ReactDOMServerRenderingStub';
    
  37. import type {Awaited} from 'shared/ReactTypes';
    
  38. 
    
  39. export function experimental_useFormStatus(): FormStatus {
    
  40.   if (__DEV__) {
    
  41.     console.error(
    
  42.       'useFormStatus is now in canary. Remove the experimental_ prefix. ' +
    
  43.         'The prefixed alias will be removed in an upcoming release.',
    
  44.     );
    
  45.   }
    
  46.   return useFormStatus();
    
  47. }
    
  48. 
    
  49. export function experimental_useFormState<S, P>(
    
  50.   action: (Awaited<S>, P) => S,
    
  51.   initialState: Awaited<S>,
    
  52.   permalink?: string,
    
  53. ): [Awaited<S>, (P) => void] {
    
  54.   if (__DEV__) {
    
  55.     console.error(
    
  56.       'useFormState is now in canary. Remove the experimental_ prefix. ' +
    
  57.         'The prefixed alias will be removed in an upcoming release.',
    
  58.     );
    
  59.   }
    
  60.   return useFormState(action, initialState, permalink);
    
  61. }