({
children,
...otherProps
}: ToastStateProps & {children: (state: ToastState<string>) => React.ReactNode})
| 19 | const ToastContext = createContext<ToastState<string> | null>(null); |
| 20 | |
| 21 | export function ToastContainer({ |
| 22 | children, |
| 23 | ...otherProps |
| 24 | }: ToastStateProps & {children: (state: ToastState<string>) => React.ReactNode}): JSX.Element { |
| 25 | let state = useToastState<string>(otherProps); |
| 26 | return ( |
| 27 | <ToastContext.Provider value={state}> |
| 28 | {children(state)} |
| 29 | <ToastRegion /> |
| 30 | </ToastContext.Provider> |
| 31 | ); |
| 32 | } |
| 33 | |
| 34 | function ToastRegion() { |
| 35 | let state = useContext(ToastContext)!; |
nothing calls this directly
no test coverage detected