Constructor
# <withNotice />
Higher Order Component which allows you to post notice messages from your components
It gives you the additional prop: addNotice(noticeMessage)
taking NoticeMessage.
import { withNotice } from 'adminjs/core'
const MY_MESSAGE = {
message: 'I am toast message',
type: 'success',
}
const MyCustomComponent = ({ addNotice }) => {
return (
<a onClick={() => addNotice(MY_MESSAGE)}>Click Me</a>
)
}
export default withNotice(MyCustomComponent)
Type Definitions
object
# AddNoticeProps
Additional props which are passed to your component
Properties:
Name | Type | Description |
---|---|---|
addNotice |
function
|
object
# NoticeMessage
NoticeMessage which can be presented as a "Toast" message.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string
|
||
type |
'success'
|
'error'
|
<optional> |