File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 11// The "alternate renderers" entry point is primarily here to fall back on a no-op
22// version of `unstable_batchedUpdates`, for use with renderers other than ReactDOM/RN.
33// Examples include React-Three-Fiber, Ink, etc.
4- // Because of that, we'll also assume the useSyncExternalStore compat shim is needed .
4+ // We'll assume they're built with React 18 and thus have `useSyncExternalStore` available .
55
6- import { useSyncExternalStore } from 'use-sync-external-store/shim '
7- import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/ with-selector'
6+ import { useSyncExternalStore } from 'react '
7+ import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector'
88
99import { initializeUseSelector } from './hooks/useSelector'
1010import { initializeConnect } from './components/connect'
Original file line number Diff line number Diff line change 1- // The primary entry point assumes we're working with standard ReactDOM/RN, but
2- // older versions that do not include `useSyncExternalStore` (React 16.9 - 17.x).
3- // Because of that, the useSyncExternalStore compat shim is needed.
1+ // The primary 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.
45
5- import { useSyncExternalStore } from 'use-sync-external-store/shim '
6- import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/ with-selector'
6+ import { useSyncExternalStore } from 'react '
7+ import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector'
78
89import { unstable_batchedUpdates as batchInternal } from './utils/reactBatchedUpdates'
910import { setBatch } from './utils/batch'
You can’t perform that action at this time.
0 commit comments