Skip to content

Commit

Permalink
Merge pull request #5837 from marmelab/Fix-warning-syncWithLocation
Browse files Browse the repository at this point in the history
Fix syncWithLocation DOM warnings when using List
  • Loading branch information
fzaninotto authored Jan 30, 2021
2 parents ff51006 + 99cf8f0 commit 9f8ce01
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 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 @@ -44,7 +44,7 @@ export interface ListProps {
resource?: string;
// Wether to synchronize the list parameters with the current location (URL search parameters)
// This is set to true automatically when a List is used inside a Resource component
syncWithLocation: boolean;
syncWithLocation?: boolean;
[key: string]: any;
}

Expand Down
1 change: 1 addition & 0 deletions packages/ra-ui-materialui/src/list/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ List.propTypes = {
match: PropTypes.any,
path: PropTypes.string,
resource: PropTypes.string.isRequired,
syncWithLocation: PropTypes.bool,
};

List.defaultProps = {
Expand Down
1 change: 1 addition & 0 deletions packages/ra-ui-materialui/src/list/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ const sanitizeRestProps: (
setPerPage = null,
setSort = null,
showFilter = null,
syncWithLocation = null,
sort = null,
total = null,
...rest
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface ListProps extends ResourceComponentProps {
pagination?: ReactElement | false;
perPage?: number;
sort?: SortPayload;
syncWithLocation: boolean;
syncWithLocation?: boolean;
title?: string | ReactElement;
}

Expand Down

0 comments on commit 9f8ce01

Please sign in to comment.