You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Edit.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -600,7 +600,7 @@ Note that the `redirect` prop is ignored if you set [the `mutationOptions` prop]
600
600
601
601
## `render`
602
602
603
-
Alternatively to `children`, you can use a `render` prop. It will receive the [`EditContext`](./useEditContext.md#return-value) as its argument, and should return a React node.
603
+
Alternatively to `children`, you can use a `render` prop. It will receive the [`EditContext`](./useEditContext.md#return-value) as its argument, and should return a React node.
604
604
605
605
This allows to inline the render logic for the edition page.
Copy file name to clipboardExpand all lines: docs/InfiniteList.md
+8-29Lines changed: 8 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,42 +85,16 @@ Check the [`<List>` component](./List.md) for details about each prop.
85
85
86
86
Additional props are passed down to the root component (a MUI `<Card>` by default).
87
87
88
-
## `render`
89
-
90
-
Alternatively to children you can pass a render prop to `<InfiniteList>`. The render prop will receive the list context as its argument, allowing to inline the render logic for the list content.
91
-
When receiving a render prop the `<InfiniteList>` component will ignore the children property.
92
-
93
-
{% raw %}
94
-
```tsx
95
-
<InfiniteList
96
-
render={({ error, isPending }) => {
97
-
if (isPending) {
98
-
return <div>Loading...</div>;
99
-
}
100
-
if (error) {
101
-
return <div>Error: {error.message}</div>;
102
-
}
103
-
return (
104
-
<SimpleList
105
-
primaryText="%{title} (%{year})"
106
-
secondaryText="%{summary}"
107
-
tertiaryText={record=>record.year}
108
-
/>
109
-
);
110
-
}}
111
-
/>
112
-
```
113
-
{% endraw %}
114
-
115
88
## `pagination`
116
89
117
-
You can replace the default "load on scroll" pagination (triggered by a component named `<InfinitePagination>`) by a custom pagination component. To get the pagination state and callbacks, you'll need to read the `InfinitePaginationContext`.
90
+
You can replace the default "load on scroll" pagination (triggered by a component named `<InfinitePagination>`) by a custom pagination component. To get the pagination state and callbacks, you'll need to read the `InfinitePaginationContext`.
118
91
119
92

120
93
121
94
For example, here is a custom infinite pagination component displaying a "Load More" button at the bottom of the list:
`<InfiniteList>` deduces the resource and the list parameters from the URL. This is fine for a page showing a single list of records, but if you need to display more than one list in a page, you probably want to define the list parameters yourself.
175
+
`<InfiniteList>` deduces the resource and the list parameters from the URL. This is fine for a page showing a single list of records, but if you need to display more than one list in a page, you probably want to define the list parameters yourself.
199
176
200
177
In that case, use the [`resource`](./List.md#resource), [`sort`](./List.md#sort), and [`filter`](./List.md#filter-permanent-filter) props to set the list parameters.
0 commit comments