$ npm install --save openknowl-eungwang-library
$ yarn add openknowl-eungwang-library
@ required
// root경로 (ex. App.tsx)
<div id='toast-root' />
@ the gist
const { openToast } = useToast();
<button
onClick={() => {
openToast({
type: 'success',
message: 'wow!',
})
}}
>
click
</button>
https://codesandbox.io/s/romantic-mayer-5lclub?file=/src/App.tsx
Prop name | type | Default value | required |
---|---|---|---|
type | "success" | "error" | "warn" | "info" | n/a | O |
message | string | n/a | X |