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. import type {ReactNodeList} from 'shared/ReactTypes';
    
  11. 
    
  12. import {version, renderToStringImpl} from './ReactDOMLegacyServerImpl';
    
  13. import {
    
  14.   renderToNodeStream,
    
  15.   renderToStaticNodeStream,
    
  16. } from './ReactDOMLegacyServerNodeStream';
    
  17. 
    
  18. type ServerOptions = {
    
  19.   identifierPrefix?: string,
    
  20. };
    
  21. 
    
  22. function renderToString(
    
  23.   children: ReactNodeList,
    
  24.   options?: ServerOptions,
    
  25. ): string {
    
  26.   return renderToStringImpl(
    
  27.     children,
    
  28.     options,
    
  29.     false,
    
  30.     'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server',
    
  31.   );
    
  32. }
    
  33. 
    
  34. function renderToStaticMarkup(
    
  35.   children: ReactNodeList,
    
  36.   options?: ServerOptions,
    
  37. ): string {
    
  38.   return renderToStringImpl(
    
  39.     children,
    
  40.     options,
    
  41.     true,
    
  42.     'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server',
    
  43.   );
    
  44. }
    
  45. 
    
  46. export {
    
  47.   renderToString,
    
  48.   renderToStaticMarkup,
    
  49.   renderToNodeStream,
    
  50.   renderToStaticNodeStream,
    
  51.   version,
    
  52. };