DeferredContent postpones the loading the content that is initially not in the viewport until it becomes visible on scroll.
import { DeferredContent } from 'primereact/deferredcontent';
<script src="https://unpkg.com/primereact/core/core.min.js"></script>
<script src="https://unpkg.com/primereact/deferredcontent/deferredcontent.min.js"></script>
DeferredContent is used as a wrapper element of its content.
<DeferredContent onLoad={onDataLoad}>
<DataTable value={products}>
<Column field="code" header="Code"></Column>
<Column field="name" header="Name"></Column>
<Column field="category" header="Category"></Column>
<Column field="quantity" header="Quantity"></Column>
</DataTable>
</DeferredContent>
onLoad callback is useful to initialize the content when it becomes visible on scroll such as loading data.
<DeferredContent onLoad={onDataLoad}>
<DataTable value={products}>
<Column field="code" header="Code"></Column>
<Column field="name" header="Name"></Column>
<Column field="category" header="Category"></Column>
<Column field="quantity" header="Quantity"></Column>
</DataTable>
</DeferredContent>
Name | Parameters | Description |
---|---|---|
onLoad | event: Event object | Callback to invoke when deferred content is loaded. |
Component does not apply any styling.
This section is under development. After the necessary tests and improvements are made, it will be shared with the users as soon as possible.
None.
Built-in component themes created by the PrimeReact Theme Designer.
Premium themes are only available exclusively for PrimeReact Theme Designer subscribers and therefore not included in PrimeReact core.
Beautifully crafted premium create-react-app application templates by the PrimeTek design team.