我是歌谣 微信公众号关注前端小歌谣进入前端巅峰人才交流群
import { useRecordContext, Show, SimpleShowLayout } from 'react-admin';
const BookAuthor = () => {
const record = useRecordContext();
if (!record) return null;
return <span>{record.author}</span>;
};
const BookShow = () => (
<Show>
<SimpleShowLayout>
<BookAuthor />
...
</SimpleShowLayout>
</Show>
)