-
I was trying to use useToast but I wasn't able to make it work. I imported useToast from @geist/react and then just copied the code from the doc site. But when I clicked the button it didn't work. This is my code:
I greatly appreciate your help... Btw: |
Beta Was this translation helpful? Give feedback.
Answered by
ghost
May 10, 2021
Replies: 1 comment 24 replies
-
You need to use import { useToasts, Button } from '@geist-ui/react';
const Toast = () => {
const [, setToast] = useToasts();
const onClick = () => setToast({ text: 'The Evil Rabbit jumped over the fence.' });
return <Button onClick={onClick}>Show Toast</Button>;
};
export default Toast; |
Beta Was this translation helpful? Give feedback.
24 replies
Answer selected by
svrem
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to use
useToasts
in a react component.toast
should be replaced byToast
.