mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-21 20:11:43 +08:00
94e24d1b82
Co-authored-by: LongYinan <lynweklm@gmail.com>
21 lines
429 B
TypeScript
21 lines
429 B
TypeScript
import { useCallback, useState } from 'react';
|
|
|
|
import { Button } from '../button';
|
|
import { toast } from './index';
|
|
|
|
export default {
|
|
title: 'UI/Toast',
|
|
component: () => null,
|
|
};
|
|
|
|
export const Default = () => {
|
|
const [count, setCount] = useState(1);
|
|
|
|
const showToast = useCallback(() => {
|
|
toast(`Toast ${count}`);
|
|
setCount(count + 1);
|
|
}, [count]);
|
|
|
|
return <Button onClick={showToast}>Show toast</Button>;
|
|
};
|