You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ShowBase.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ const BookShow = () => (
113
113
By default, the `<ShowBase>` component will automatically redirect the user to the login page if the user is not authenticated. If you want to disable this behavior and allow anonymous access to a show page, set the `disableAuthentication` prop to `true`.
114
114
115
115
```jsx
116
-
import { ShowBase } from'ra-core';
116
+
import { ShowBase } from'react-admin';
117
117
118
118
constPostShow= () => (
119
119
<ShowBase disableAuthentication>
@@ -127,7 +127,7 @@ const PostShow = () => (
127
127
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.
By default, `<ShowBase>` renders nothing when there is no connectivity and the record hasn't been cached yet. You can provide your own component via the `offline` prop:
158
158
159
159
```jsx
160
-
import { ShowBase } from'ra-core';
160
+
import { ShowBase } from'react-admin';
161
161
162
162
exportconstPostShow= () => (
163
163
<ShowBase offline={<p>No network. Could not load the post.</p>}>
**Tip**: If the record is in the Tanstack Query cache but you want to warn the user that they may see an outdated version, you can use the `<IsOffline>` component:
170
170
171
171
```jsx
172
-
import { ShowBase, IsOffline } from'ra-core';
172
+
import { ShowBase, IsOffline } from'react-admin';
173
173
174
174
exportconstPostShow= () => (
175
175
<ShowBase offline={<p>No network. Could not load the post.</p>}>
@@ -258,7 +258,7 @@ const BookShow = () => (
258
258
By default, `<ShowBase>` operates on the current `ResourceContext` (defined at the routing level), so under the `/posts/1/show` path, the `resource` prop will be `posts`. You may want to force a different resource. In this case, pass a custom `resource` prop, and it will override the `ResourceContext` value.
0 commit comments