Skip to main content

useRecentShops

The useRecentShops hook fetches shops the user recently interacted with in the Shop app, ordered by recency. You can use this to create quick access to favorite stores or personalized shop recommendations.

Anchor to params
params

Examples

tsx

import {useRecentShops, Button} from '@shopify/shop-minis-react'

export default function MyComponent() {
const {shops, loading, error, hasNextPage, loadMore} = useRecentShops({
first: 10,
})

console.log({shops, loading, error})

return (
<>
{/* Render shops here */}
{hasNextPage && (
<Button onClick={loadMore} disabled={loading}>
Load More
</Button>
)}
</>
)
}

Was this page helpful?