Skip to content

Commit

Permalink
Make deferredRendering optional by providing a good default (false).
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 21, 2023
1 parent 90c9ab3 commit 2122329
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/dataviews/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Array of operations that can be performed upon each record. Each action is an ob
- `getItemId`: function that receives an item and returns an unique identifier for it. By default, it uses the `id` of the item as unique identifier. If it's not, the consumer should provide their own.
- `isLoading`: whether the data is loading. `false` by default.
- `supportedLayouts`: array of layouts supported. By default, all are: `table`, `grid`, `list`.
- `deferredRendering`: whether the items should be rendered asynchronously. Required.
- `deferredRendering`: whether the items should be rendered asynchronously. Useful when there's a field that takes a lot of time (e.g.: previews). `false` by default.
- `onSelectionChange`: callback that returns the selected items. So far, only the `list` view implements this.

## Contributing to this package
Expand Down
2 changes: 1 addition & 1 deletion packages/dataviews/src/dataviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function DataViews( {
paginationInfo,
supportedLayouts,
onSelectionChange,
deferredRendering,
deferredRendering = false,
} ) {
const [ selection, setSelection ] = useState( [] );

Expand Down
1 change: 0 additions & 1 deletion packages/edit-site/src/components/page-pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ export default function PagePages() {
view={ view }
onChangeView={ onChangeView }
onSelectionChange={ onSelectionChange }
deferredRendering={ false }
/>
</Page>
{ view.type === LAYOUT_LIST && (
Expand Down

0 comments on commit 2122329

Please sign in to comment.