useToast (Toast.tsx)

lumiere · src/components/ui/Toast.tsx · typescript · MIT
ui, chat

Hook exposing reactive toast UI, wraps component children.

// Source: https://github.com/ajamaica/lumiere | License: MIT | Copyright 2026 ajamaica
// Provided via justclaw.it.com; keep this notice with the code.
import { Ionicons } from '@expo/vector-icons'
import React, { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react'
import { StyleSheet, TouchableOpacity, View } from 'react-native'
import Animated, {
  Easing,
  runOnJS,
  useAnimatedStyle,
  useSharedValue,
  withTiming,
} from 'react-native-reanimated'

import { useReducedMotion } from '../../hooks/useReducedMotion'
import { useTheme } from '../../theme'
import { Text } from './Text'

type ToastVariant = 'success' | 'error' | 'warning' | 'info'

interface ToastMessage {
  id: number
  message: string
  variant: ToastVariant
}

interface ToastContextValue {
 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key