useSearchQuery
This hook manages the search input value in page state. It provides the current search query and a setter to update it, typically used with the search input field.
Import
import { useSearchQuery } from '@appmaker-xyz/shopify';
Basic Usage
const { searchQuery, setSearchQuery } = useSearchQuery();
// Update the search input
setSearchQuery('red shoes');
Return Value
| Property | Type | Description |
|---|---|---|
searchQuery | string | The current search input value (defaults to empty string). |
setSearchQuery | Function | Updates the search input value in page state. Signature: (value: string) => void. |