Skip to content

Commit

Permalink
Merge pull request #6017 from marmelab/fix-hasCreate-prop-required-in…
Browse files Browse the repository at this point in the history
…-list

Fix warnings about missing props when using <List> as a standalone component
  • Loading branch information
djhi authored Mar 9, 2021
2 parents 54a5e26 + cafdd9e commit 58e00dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/ra-core/src/controller/useListController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export interface ListControllerProps<RecordType extends Record = Record> {
exporter?: Exporter | false;
filter?: FilterPayload;
filterValues: any;
hasCreate: boolean;
hasCreate?: boolean;
hideFilter: (filterName: string) => void;
ids: Identifier[];
loading: boolean;
Expand Down
8 changes: 4 additions & 4 deletions packages/ra-ui-materialui/src/list/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ List.propTypes = {
title: TitlePropType,
// the props managed by react-admin
authProvider: PropTypes.func,
hasCreate: PropTypes.bool.isRequired,
hasEdit: PropTypes.bool.isRequired,
hasList: PropTypes.bool.isRequired,
hasShow: PropTypes.bool.isRequired,
hasCreate: PropTypes.bool,
hasEdit: PropTypes.bool,
hasList: PropTypes.bool,
hasShow: PropTypes.bool,
location: PropTypes.any,
match: PropTypes.any,
path: PropTypes.string,
Expand Down

0 comments on commit 58e00dc

Please sign in to comment.