Skip to content

Commit

Permalink
fix useCmdk return type (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmurray authored Nov 10, 2024
1 parent c1f200a commit 9827edf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmdk/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ function mergeRefs<T = any>(refs: Array<React.MutableRefObject<T> | React.Legacy
}

/** Run a selector against the store state. */
function useCmdk<T = any>(selector: (state: State) => T) {
function useCmdk<T = any>(selector: (state: State) => T): T {
const store = useStore()
const cb = () => selector(store.snapshot())
return useSyncExternalStore(store.subscribe, cb, cb)
Expand Down

0 comments on commit 9827edf

Please sign in to comment.