Components

LazyCollection

LazyCollection()

Constructor

new LazyCollection()

This component can be used to render a collection, but with the components being lazy. This takes all the same options as Collection, but with a lazyAfter prop. This Component also accepts extra props, which will be passed down to collection templates.

This Component is similar to Collection. Please see that for a more detailed example.

Note: This does not accept interstitial items (yet). And home page items are not hidden after being rendered

import { LazyCollection } from '@quintype/components'

// collection = Collection.getCollectionBySlug(client, 'home', {}, {depth: 1})

<LazyCollection collection={collection}
                collectionTemplates={collectionTemplates}
                storyTemplates={storyTemplates}
                lazyAfter={3}
                extraProp="some prop" />

PropTypes:
Name Type Required Description Default
className string No
collection object No
collectionTemplates func No "() => CollectionNotImplemented"
storyTemplates func No "() => StoryNotImplemented"

View Source components/lazy-collection.js, line 29