()
| 285 | } |
| 286 | |
| 287 | function ExampleToast() { |
| 288 | const { toast } = useToast(); |
| 289 | const variants: ToastVariant[] = [ |
| 290 | 'default', |
| 291 | 'success', |
| 292 | 'destructive', |
| 293 | 'info', |
| 294 | ]; |
| 295 | |
| 296 | return ( |
| 297 | <Button |
| 298 | label="Toast" |
| 299 | onPress={() => { |
| 300 | variants.forEach((variant, index) => { |
| 301 | setTimeout(() => { |
| 302 | toast(`${variant} toast`, variant, 3000, 'bottom', true); |
| 303 | }, index * 1000); |
| 304 | }); |
| 305 | }} |
| 306 | /> |
| 307 | ); |
| 308 | } |