diff --git a/README.md b/README.md index 6304b1c..955a7e7 100644 --- a/README.md +++ b/README.md @@ -222,14 +222,14 @@ const [loading, setLoading] = React.useState(false) return {loading && Hang on…} ``` -### `useCmdk(state => state.selectedField)` +### `useCommandState(state => state.selectedField)` Hook that composes [`useSyncExternalStore`](https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore). Pass a function that returns a slice of the command menu state to re-render when that slice changes. This hook is provided for advanced use cases and should not be commonly used. A good use case would be to render a more detailed empty state, like so: ```tsx -const search = useCmdk((state) => state.search) +const search = useCommandState((state) => state.search) return No results found for "{search}". ``` @@ -292,7 +292,7 @@ If your items have nested sub-items that you only want to reveal when searching, ```tsx const SubItem = (props) => { - const search = useCmdk((state) => state.search) + const search = useCommandState((state) => state.search) if (!search) return null return }