Skip to main content

useProductWishList

Overview​

This hook is used to add or remove products from wishlist.

ParameterTypeDescription
toggleWishListFunctionThis function is used to add or remove products from wishlist.
isSavedBooleanThis 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>
);
};