useWishlistProducts
This hook is used to get the wishlist products.
props | Type | Description |
---|---|---|
products | Array | Array of products |
isLoading | Boolean | Loading state |
Usage
import { useWishlistProducts } from '@appmaker-xyz/shopify';
const WishTest = (props) => {
const { products, isLoading } = useWishlistProducts();
if (isLoading) {
return (
<View>
<Text>Loading</Text>
</View>
);
}
if (products.length > 0) {
return (
<View>
<Text>Wish test component</Text>
{products.map((product) => (
<Text key={product.id}>{product.title}</Text>
))}
</View>
);
}
return (
<View>
<Text>Empty</Text>
</View>
);
};
export default WishTest;