useCollectionItemBidsList

💡 Use this hook to get the bids list of the selected collection item.

The item will be automatically selected based on url parameters from urlPattern (see MojitoHooksProvider for more details).

The useCollectionItemBidsList hook will return the bids list from calling the collectionItemById API.

Hooks Sample Code

...
import useCollectionItemBidsList from "mojito-hooks/useCollectionItemBidsList";

function App {
    const { bids, isLoading } = useCollectionItemBidsList();

    if(isLoading) return <Loader />;

    if(bids) return (
        <div>
            {bids.map((item) => <DrawBid bid={bid} />)}
        </div>
    );

    return <div>No bids available</div>
}

Parameters

PropertyDescriptionType
collectionItemIDThe collection item ID.String

Result

PropertyDescriptionType
bidsArray of bids associated with the collection item ID.MojitoMarketplaceAuctionBid[]
isLoadingDisplay request loading status, provided for convenience.Boolean
errorThe error object for the query, if an error was thrown.Error
refetchA function to manually refetch the query.(options: T) => Promise<U>
queryResultOriginal React-Query query result.QueryResult<T>