UNPKG

956 BJavaScriptView Raw
1// The secondary entry point assumes we are working with React 18, and thus have
2// useSyncExternalStore available. We can import that directly from React itself.
3// The useSyncExternalStoreWithSelector has to be imported, but we can use the
4// non-shim version. This shaves off the byte size of the shim.
5import { useSyncExternalStore } from 'react';
6import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector';
7import { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';
8import { setBatch } from './utils/batch';
9import { initializeUseSelector } from './hooks/useSelector';
10import { initializeConnect } from './components/connect';
11initializeUseSelector(useSyncExternalStoreWithSelector);
12initializeConnect(useSyncExternalStore); // Enable batched updates in our subscriptions for use
13// with standard React renderers (ReactDOM, React Native)
14
15setBatch(batch);
16export { batch };
17export * from './exports';
\No newline at end of file