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
| content |`node`||`undefined`| Содержимое уведомления. Оно может включать [все, что можно отобразить: числа, строки, элементы или массив](https://reactjs.org/docs/typechecking-with-proptypes.html#proptypes). |
110
110
| theme |`string`||`"normal"`| Тема уведомления. Возможные значения: `"normal"`, `"info"`, `"success"`, `"warning"`, `danger`, `"utility"`. Если для `theme` установить любое значение, кроме `"normal"`, в заголовок уведомления добавится иконка. _По умолчанию иконка отсутствует_. |
111
111
| isClosable |`boolean`||`true`| Конфигурация, управляющая отображением иконки X, которая позволяет пользователю закрыть уведомление. |
112
-
| actions |`ToastAction[]`||`undefined`| Массив [действий](./types.ts#L9), отображаемых после `content`. |
112
+
| actions |`ToastAction[] \| () => ReactElement`||`undefined`| Массив [действий](./types.ts#L9), отображаемых после `content`, или коллбек, возвращающий элемент React.|
113
113
| renderIcon |`(toastProps: ToastProps) => ReactNode`||`undefined`| Используется для кастомизации иконки тоста. По умолчанию используется поведение на основе типа. |
114
114
115
115
Каждое действие (`action`) — это объект со следующими параметрами:
Copy file name to clipboardExpand all lines: src/components/Toaster/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ It accepts the `toastOptions` argument with the ongoing notification details:
111
111
| content |`node`||`undefined`| Notification content. This may be [anything that can be rendered: numbers, strings, elements, or an array](https://reactjs.org/docs/typechecking-with-proptypes.html#proptypes)|
112
112
| theme |`string`||`"normal"`| Notification theme. The possible values are `"normal"`, `"info"`, `"success"`, `"warning"`, `danger`, and `"utility"`. If `theme` is set to anything but `"normal"`, the icon will be added into the notification title. _By default, there is no icon_. |
113
113
| isClosable |`boolean`||`true`| Configuration that manages the visibility of the X icon, which allows the user to close the notification |
114
-
| actions |`ToastAction[]`||`undefined`| Array of [actions](./types.ts#L9) that are displayed after `content`|
114
+
| actions |`ToastAction[] \| () => ReactElement`||`undefined`| Array of [actions](./types.ts#L9) that are displayed after `content`, or callback, that returned required actions|
115
115
| renderIcon |`(toastProps: ToastProps) => ReactNode`||`undefined`| Used to customize the toast icon. Type-based behavior is used by default |
116
116
117
117
Every `action` is an object with following parameters:
0 commit comments