我是歌谣 放弃很容易 但是坚持一定很酷 微信公众号关注前端小歌谣带你进入前端技术群
import { WithListContext } from 'react-admin';
import { Typography } from '@mui/material';
export const Aside = () => (
<WithListContext render={({ data, isLoading }) =>
!isLoading && (
<div>
<Typography variant="h6">Posts stats</Typography>
<Typography variant="body2">
Total views: {data.reduce((sum, post) => sum +
post.views, 0)}
</Typography>
</div>
)} />
);