import React from 'react' ; import { StatedBeanApplication } from '../core/StatedBeanApplication' ; import { useContainer } from '../hooks/useContainer' ; import { Provider } from '../types' ; import { getStatedBeanContext } from './StatedBeanContext' ; export interface StatedBeanProviderProps < T = unknown > { providers ? : Array < Provider < T > > ; application ? : StatedBeanApplication ; children : React . ReactNode | React . ReactNode [ ] | null ; } export const StatedBeanProvider = ( { providers , application , children } ) => { const StatedBeanContext = getStatedBeanContext ( ) ; const container = useContainer ( { providers , application } ) ; return < StatedBeanContext . Provider value = { { container } } > { children } < /StatedBeanContext.Provider>; } ;