import React , { createRef } from 'react' ; import { ToasterBase } from './ToasterBase' ; import type { ToastProperties } from './components/Toast/typings' ; import type { ToasterMethods } from './typings' ; import { defaultStyleWorklet } from './components/ToastContainer/defaultStyleWorklet' ; export const ToasterRef = createRef < ToasterMethods < ToastProperties > > ( ) ; export const ToasterHelper = { show : ( options ) => ToasterRef . current ?. show ( options ) ! , hide : ( id ) => ToasterRef . current ?. hide ( id ) , filter : ( fn ) => ToasterRef . current ?. filter ( fn ) , update : ( id , options ) => ToasterRef . current ?. update ( id , options ) , } ; export const Toaster = ( ) => { return ( < ToasterBase onSwipeEdge = { ( { filter } ) => filter ( ( e ) => e . loading ) } ref = { ToasterRef } itemStyle = { defaultStyleWorklet } / > ) ; } ;