Skip to content

Commit 526d088

Browse files
authored
Merge pull request #10416 from marmelab/doc-ShowBase-emptyWhileLoading
[Doc] Remove `<ShowBase emptyWhileLoading>` from the docs
2 parents bdf5cce + 8c01e20 commit 526d088

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

docs/ShowBase.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import { Grid } from '@mui/material';
8181
import StarIcon from '@mui/icons-material/Star';
8282

8383
const BookShow = () => (
84-
<ShowBase emptyWhileLoading>
84+
<ShowBase>
8585
<Grid container spacing={2} sx={{ margin: 2 }}>
8686
<Grid item xs={12} sm={6}>
8787
<TextField label="Title" source="title" />
@@ -117,20 +117,6 @@ const PostShow = () => (
117117
);
118118
```
119119

120-
## `emptyWhileLoading`
121-
122-
By default, `<ShowBase>` renders its child component even before the `dataProvider.getOne()` call returns. If you use `<SimpleShowLayout>` or `<TabbedShowLayout>`, this isn't a problem as these components only render when the record has been fetched. But if you use a custom child component that expects the record context to be defined, your component will throw an error.
123-
124-
The `<ShowBase emptyWhileLoading>` prop provides a convenient shortcut for that use case. When enabled, `<ShowBase>` won't render its child until the record is loaded.
125-
126-
```jsx
127-
const BookShow = () => (
128-
<ShowBase emptyWhileLoading>
129-
...
130-
</ShowBase>
131-
);
132-
```
133-
134120
## `id`
135121

136122
By default, `<ShowBase>` deduces the identifier of the record to show from the URL path. So under the `/posts/123/show` path, the `id` prop will be `123`. You may want to force a different identifier. In this case, pass a custom `id` prop.

0 commit comments

Comments
 (0)