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 {
    
  11.   preinit,
    
  12.   preinitModule,
    
  13.   preload,
    
  14.   preloadModule,
    
  15.   preconnect,
    
  16.   prefetchDNS,
    
  17. } from '../shared/ReactDOMFloat';
    
  18. export {
    
  19.   useFormStatus,
    
  20.   useFormState,
    
  21. } from 'react-dom-bindings/src/shared/ReactDOMFormActions';
    
  22. 
    
  23. export function createPortal() {
    
  24.   throw new Error(
    
  25.     'createPortal was called on the server. Portals are not currently' +
    
  26.       ' supported on the server. Update your program to conditionally call' +
    
  27.       ' createPortal on the client only.',
    
  28.   );
    
  29. }
    
  30. 
    
  31. export function flushSync() {
    
  32.   throw new Error(
    
  33.     'flushSync was called on the server. This is likely caused by a' +
    
  34.       ' function being called during render or in module scope that was' +
    
  35.       ' intended to be called from an effect or event handler. Update your' +
    
  36.       ' to not call flushSync no the server.',
    
  37.   );
    
  38. }
    
  39. 
    
  40. // on the server we just call the callback because there is
    
  41. // not update mechanism. Really this should not be called on the
    
  42. // server but since the semantics are generally clear enough we
    
  43. // can provide this trivial implementation.
    
  44. function batchedUpdates<A, R>(fn: A => R, a: A): R {
    
  45.   return fn(a);
    
  46. }
    
  47. 
    
  48. export {batchedUpdates as unstable_batchedUpdates};