import { Toast, useToastController, useToastState } from '@tamagui/toast' import React from 'react' import { Button, Label, Switch, XStack, YStack } from 'tamagui' /** * IMPORTANT NOTE: if you're copy-pasting this demo into your code, make sure to add: * - at the root * - where you want to show the toasts */ export const ToastV1Demo = () => { const [native, setNative] = React.useState(false) return ( ) } const CurrentToast = () => { const currentToast = useToastState() if (!currentToast || currentToast.isHandledNatively) return null return ( {currentToast.title} {!!currentToast.message && ( {currentToast.message} )} ) } const ToastControl = ({ native }: { native: boolean }) => { const toast = useToastController() return ( ) } const NativeOptions = ({ native, setNative, }: { native: boolean setNative: (native: boolean) => void }) => { return ( setNative(val)} > ) }