Skip to content

Commit

Permalink
Merge pull request #5658 from WiXSL/docs-fix-sample
Browse files Browse the repository at this point in the history
[Docs] Fix List examples
  • Loading branch information
fzaninotto committed Dec 11, 2020
2 parents be749b7 + aa6b919 commit b092973
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -1759,8 +1759,9 @@ export const PaginationActions = props => <RaPaginationActions {...props} color=
export const Pagination = props => <RaPagination {...props} ActionsComponent={PaginationActions} />;

export const UserList = props => (
<List {...props} pagination={<Pagination />}>
</List>
<List {...props} pagination={<Pagination />} />
...
</List
);
```

Expand Down Expand Up @@ -1799,6 +1800,7 @@ You can use `ListBase` to create your own custom List component, like this one:

```jsx
import * as React from 'react';
import { cloneElement } from 'react';
import {
Datagrid,
ListBase,
Expand All @@ -1817,7 +1819,7 @@ const PostList = props => (
</MyList>
);

const MyList = props => (
const MyList = ({children, ...props}) => (
<ListBase {...props}>
<h1>{props.title}</h1>
<ListToolbar
Expand Down

0 comments on commit b092973

Please sign in to comment.