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. 'use strict';
    
  11. 
    
  12. // Intentionally not using named imports because Rollup uses dynamic
    
  13. // dispatch for CommonJS interop named imports.
    
  14. import * as React from 'react';
    
  15. 
    
  16. export const useSyncExternalStore = React.useSyncExternalStore;
    
  17. 
    
  18. if (__DEV__) {
    
  19.   console.error(
    
  20.     "The main 'use-sync-external-store' entry point is not supported; all it " +
    
  21.       "does is re-export useSyncExternalStore from the 'react' package, so " +
    
  22.       'it only works with React 18+.' +
    
  23.       '\n\n' +
    
  24.       'If you wish to support React 16 and 17, import from ' +
    
  25.       "'use-sync-external-store/shim' instead. It will fall back to a shimmed " +
    
  26.       'implementation when the native one is not available.' +
    
  27.       '\n\n' +
    
  28.       "If you only support React 18+, you can import directly from 'react'.",
    
  29.   );
    
  30. }