Skip to content

Commit

Permalink
remove use-sync-external-store shim
Browse files Browse the repository at this point in the history
  • Loading branch information
pacocoursey committed Oct 31, 2024
1 parent eab8e0f commit 0b290ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
5 changes: 2 additions & 3 deletions cmdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
"react-dom": "^18 || ^19 || ^19.0.0-rc"
},
"dependencies": {
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-id": "^1.1.0",
"@radix-ui/react-primitive": "^2.0.0",
"use-sync-external-store": "^1.2.2"
"@radix-ui/react-primitive": "^2.0.0"
},
"devDependencies": {
"@types/react": "18.0.15"
Expand Down
5 changes: 3 additions & 2 deletions cmdk/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use client'

import * as RadixDialog from '@radix-ui/react-dialog'
import * as React from 'react'
import { commandScore } from './command-score'
import { Primitive } from '@radix-ui/react-primitive'
import { useId } from '@radix-ui/react-id'
import { useSyncExternalStore } from 'use-sync-external-store'

type Children = { children?: React.ReactNode }
type DivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>
Expand Down Expand Up @@ -1016,7 +1017,7 @@ function mergeRefs<T = any>(refs: Array<React.MutableRefObject<T> | React.Legacy
function useCmdk<T = any>(selector: (state: State) => T) {
const store = useStore()
const cb = () => selector(store.snapshot())
return useSyncExternalStore(store.subscribe, cb, cb)
return React.useSyncExternalStore(store.subscribe, cb, cb)
}

function useValue(
Expand Down
13 changes: 1 addition & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b290ce

Please sign in to comment.