Skip to content

Commit

Permalink
Fix SimpleList does not propagate its resource prop
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Jan 8, 2025
1 parent 6ac6fa4 commit 8d6fd0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const SimpleList = <RecordType extends RaRecord = any>(
ref,
rowSx,
rowStyle,
resource,
...rest
} = props;
const { data, isPending, total } =
Expand Down Expand Up @@ -121,6 +122,7 @@ export const SimpleList = <RecordType extends RaRecord = any>(
rowClick={rowClick}
rowSx={rowSx}
rowStyle={rowStyle}
resource={resource}
>
<SimpleListItemContent
leftAvatar={leftAvatar}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const SimpleListItem = <RecordType extends RaRecord = any>(
typeof linkType === 'function' || typeof rowClick === 'function';
const pathForRecord = useGetPathForRecord({
link: isFunctionLink ? false : linkType ?? rowClick,
resource,
});
const getPathForRecord = useGetPathForRecordCallback();
const handleClick = useEvent(async () => {
Expand Down

0 comments on commit 8d6fd0e

Please sign in to comment.