useProductWishList
Overview
This hook is used to add or remove products from wishlist.
Parameter | Type | Description |
---|---|---|
toggleWishList | Function | This function is used to add or remove products from wishlist. |
isSaved | Boolean | This variable is used to check whether the product is saved in wishlist or not. |
Usage
import { useProductWishList } from '@appmaker-xyz/shopify';
const Product = () => {
const { toggleWishList, isSaved } = useProductWishList();
return (
<View>
<Button onPress={toggleWishList}>
{isSaved ? 'Remove from wishlist' : 'Add to wishlist'}
</Button>
</View>
);
};