Skip to content

Commit

Permalink
Fix uSES imports
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Sep 25, 2023
1 parent 34d1653 commit a0c7a4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/alternate-renderers.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
'use client'

// The "alternate renderers" entry point is primarily here to fall back on a no-op
// version of `unstable_batchedUpdates`, for use with renderers other than ReactDOM/RN.
// Examples include React-Three-Fiber, Ink, etc.
// We'll assume they're built with React 18 and thus have `useSyncExternalStore` available.

import * as React from 'react'
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector'
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector.js'

import { initializeUseSelector } from './hooks/useSelector'
import { initializeConnect } from './components/connect'
Expand Down
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
'use client'

// The primary entry point assumes we are working with React 18, and thus have
// useSyncExternalStore available. We can import that directly from React itself.
// The useSyncExternalStoreWithSelector has to be imported, but we can use the
// non-shim version. This shaves off the byte size of the shim.

import * as React from 'react'
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector'
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector.js'

import { unstable_batchedUpdates as batchInternal } from './utils/reactBatchedUpdates'
import { setBatch } from './utils/batch'
Expand Down

0 comments on commit a0c7a4b

Please sign in to comment.