AppmakerDeveloper

useWishlistProducts

This hook is used to get the wishlist products.

propsTypeDescription
productsArrayArray of products
isLoadingBooleanLoading 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;

On this page