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/Admin.md
+31-3
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,7 @@ Here are all the props accepted by the component:
46
46
-[`ready`](#ready)
47
47
-[`requireAuth`](#requireauth)
48
48
-[`store`](#store)
49
+
-[`notification`](#notification)
49
50
50
51
## `dataProvider`
51
52
@@ -399,20 +400,20 @@ const App = () => (
399
400
);
400
401
```
401
402
402
-
Your custom layout can simply extend [the default `<Layout>` component](./Layout.md) if you only want to override the appBar, the menu, the notification component, or the error page. For instance:
403
+
Your custom layout can simply extend [the default `<Layout>` component](./Layout.md) if you only want to override the appBar, the menu, or the error page. For instance:
403
404
404
405
```jsx
405
406
// in src/MyLayout.js
406
407
import { Layout } from'react-admin';
407
408
importMyAppBarfrom'./MyAppBar';
408
409
importMyMenufrom'./MyMenu';
409
-
importMyNotificationfrom'./MyNotification';
410
+
importMyErrorfrom'./MyError';
410
411
411
412
constMyLayout= (props) =><Layout
412
413
{...props}
413
414
appBar={MyAppBar}
414
415
menu={MyMenu}
415
-
notification={MyNotification}
416
+
error={MyError}
416
417
/>;
417
418
418
419
exportdefaultMyLayout;
@@ -533,6 +534,33 @@ const App = () => (
533
534
);
534
535
```
535
536
537
+
## `notification`
538
+
539
+
You can override the notification component, for instance to change the notification duration. A common use case is to change the `autoHideDuration`, and force the notification to remain on screen longer than the default 4 seconds. For instance, to create a custom Notification component with a 5 seconds default:
You might want to dynamically define the resources when the app starts. To do so, you have two options: using a function as `<Admin>` child, or unplugging it to use a combination of `AdminContext` and `<AdminUI>` instead.
Copy file name to clipboardexpand all lines: docs/Theming.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -1009,13 +1009,13 @@ const App = () => (
1009
1009
1010
1010
## Notifications
1011
1011
1012
-
You can override the notification component, for instance to change the notification duration. It defaults to 4000, i.e. 4 seconds, and you can override it using the `autoHideDuration` prop. For instance, to create a custom Notification component with a 5 seconds default:
1012
+
You can override the notification component, for instance to change the notification duration. A common use case is to change the `autoHideDuration`, and force the notification to remain on screen longer than the default 4 seconds. For instance, to create a custom Notification component with a 5 seconds default:
0 commit comments