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