Skip to content

Commit 471a076

Browse files
authored
Merge pull request #6146 from marmelab/fix-simplelistloading-warnings
Fix warnings when SimpleList displays skeleton while loading
2 parents 8cba994 + 650979f commit 471a076

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/ra-ui-materialui/src/list/Placeholder.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ interface Props {
2121
const Placeholder: FC<Props> = props => {
2222
const classes = useStyles(props);
2323
return (
24-
<div className={classnames(classes.root, props.className)}>&nbsp;</div>
24+
<span className={classnames(classes.root, props.className)}>
25+
&nbsp;
26+
</span>
2527
);
2628
};
2729

packages/ra-ui-materialui/src/list/SimpleListLoading.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const SimpleListLoading: FC<Props & ListProps> = props => {
5353
return oneSecondHasPassed ? (
5454
<List className={className} {...rest}>
5555
{times(nbFakeLines, key => (
56-
<ListItem>
56+
<ListItem key={key}>
5757
{hasLeftAvatarOrIcon && (
5858
<ListItemAvatar>
5959
<Avatar>&nbsp;</Avatar>

0 commit comments

Comments
 (0)