Appearance
useCategory ​
Definition ​
Composable to get the category from current CMS context
Basic usage ​
ts
const {  category } = useCategory(category);
Signature ​
ts
export function useCategory(
  category?: Ref<Schemas["Category"]>,
): UseCategoryReturn 
Parameters ​
| Name | Type | Description | 
|---|---|---|
| category | Ref<>  | 
Return type ​
See UseCategoryReturn
ts
export type UseCategoryReturn = {
  /**
   * Current category entity
   */
  category: ComputedRef<Schemas["Category"]>;
};
Properties ​
| Name | Type | Description | 
|---|---|---|
| category | ComputedRef<>  | Current category entity | 
Usage ​
ts
import { useCategory } from "@shopware-pwa/composables-next";
const { search } = useCategory();