Skip to content

Commit e11024e

Browse files
committed
simplify CoreAdmin usage
1 parent a6c7bec commit e11024e

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

docs_headless/src/content/docs/create-edit/CreateBase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ const PostCreate = () => (
321321
{ action: "create", resource: "posts" }
322322
```
323323

324-
Users without access will be redirected to the [Access Denied page](../app-configuration/CoreAdminUI.md#accessdenied).
324+
Users without access will be redirected to the [Access Denied page](../app-configuration/CoreAdmin.md#accessdenied).
325325

326326
**Note**: Access control is disabled when you use the [`disableAuthentication`](#disableauthentication) prop.
327327

docs_headless/src/content/docs/create-edit/EditBase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ const PostEdit = () => (
488488
{ action: "edit", resource: "posts" }
489489
```
490490

491-
Users without access will be redirected to the [Access Denied page](../app-configuration/CoreAdminUI.md#accessdenied).
491+
Users without access will be redirected to the [Access Denied page](../app-configuration/CoreAdmin.md#accessdenied).
492492

493493
**Note**: Access control is disabled when you use the [`disableAuthentication`](#disableauthentication) prop.
494494

docs_headless/src/content/docs/recipes/Caching.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ React-admin uses react-query for data fetching. React-query comes with its own c
8888

8989
```jsx
9090
import { QueryClient } from '@tanstack/react-query';
91-
import { CoreAdminContext, CoreAdminUI } from 'ra-core';
91+
import { CoreAdmin, Resource } from 'ra-core';
9292

9393
const App = () => {
9494
const queryClient = new QueryClient({
@@ -99,11 +99,9 @@ const App = () => {
9999
},
100100
});
101101
return (
102-
<CoreAdminContext dataProvider={dataProvider} queryClient={queryClient}>
103-
<CoreAdminUI>
104-
<Resource name="posts" />
105-
</CoreAdminUI>
106-
</CoreAdminContext>
102+
<CoreAdmin dataProvider={dataProvider} queryClient={queryClient}>
103+
<Resource name="posts" />
104+
</CoreAdmin>
107105
);
108106
}
109107
```

docs_headless/src/content/docs/show/ShowBase.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,15 @@ Components using `<ShowBase>` can be used as the `show` prop of a `<Resource>` c
4040

4141
```jsx
4242
// in src/App.jsx
43-
import { CoreAdminContext, CoreAdminUI, Resource } from 'ra-core';
43+
import { CoreAdmin, Resource } from 'ra-core';
4444

4545
import { dataProvider } from './dataProvider';
4646
import { PostShow } from './posts';
4747

4848
const App = () => (
49-
<CoreAdminContext dataProvider={dataProvider}>
50-
<CoreAdminUI>
51-
<Resource name="posts" show={PostShow} />
52-
</CoreAdminUI>
53-
</CoreAdminContext>
49+
<CoreAdmin dataProvider={dataProvider}>
50+
<Resource name="posts" show={PostShow} />
51+
</CoreAdmin>
5452
);
5553
```
5654

@@ -295,6 +293,6 @@ const PostShow = () => (
295293
{ action: "show", resource: "posts" }
296294
```
297295

298-
Users without access will be redirected to the [Access Denied page](../app-configuration/CoreAdminUI.md#accessdenied).
296+
Users without access will be redirected to the [Access Denied page](../app-configuration/CoreAdmin.md#accessdenied).
299297

300298
**Note**: Access control is disabled when you use [the `disableAuthentication` prop](#disableauthentication).

0 commit comments

Comments
 (0)