MCPcopy Create free account
hub / github.com/Mobilecn-UI/nativecn-ui / ExampleToast

Function ExampleToast

App.tsx:287–308  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

285}
286
287function 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}

Callers

nothing calls this directly

Calls 2

useToastFunction · 0.90
toastFunction · 0.85

Tested by

no test coverage detected