Skip to content

Commit d46ed21

Browse files
committed
use built-in React uSES
1 parent ec02b5e commit d46ed21

3 files changed

Lines changed: 2 additions & 16 deletions

File tree

cmdk/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
"@radix-ui/react-compose-refs": "^1.1.1",
3030
"@radix-ui/react-dialog": "^1.1.6",
3131
"@radix-ui/react-id": "^1.1.0",
32-
"@radix-ui/react-primitive": "^2.0.2",
33-
"use-sync-external-store": "^1.2.2"
32+
"@radix-ui/react-primitive": "^2.0.2"
3433
},
3534
"devDependencies": {
3635
"@types/react": "18.0.15"

cmdk/src/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { commandScore } from './command-score'
66
import { Primitive } from '@radix-ui/react-primitive'
77
import { useId } from '@radix-ui/react-id'
88
import { composeRefs } from '@radix-ui/react-compose-refs'
9-
import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js'
109

1110
type Children = { children?: React.ReactNode }
1211
type DivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>
@@ -1003,7 +1002,7 @@ function useLazyRef<T>(fn: () => T) {
10031002
function useCmdk<T = any>(selector: (state: State) => T): T {
10041003
const store = useStore()
10051004
const cb = () => selector(store.snapshot())
1006-
return useSyncExternalStore(store.subscribe, cb, cb)
1005+
return React.useSyncExternalStore(store.subscribe, cb, cb)
10071006
}
10081007

10091008
function useValue(

pnpm-lock.yaml

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)