({children}: ToastProviderProps)
| 19 | } |
| 20 | |
| 21 | export function ToastProvider({children}: ToastProviderProps) { |
| 22 | let state = useToastState<string>({maxVisibleToasts: 5}); |
| 23 | |
| 24 | return ( |
| 25 | <> |
| 26 | {children(state)} |
| 27 | {state.visibleToasts.length > 0 && <ToastRegion state={state} />} |
| 28 | </> |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | function ToastRegion({state, ...props}: AriaToastRegionProps & {state: ToastState<string>}) { |
| 33 | let ref = useRef<HTMLDivElement>(null); |
nothing calls this directly
no test coverage detected