Skip to main content
Version: 0.1.2

Variable: Injector

Imported from @react-logic/di

const Injector: FunctionComponent<InjectorProviderProps>

Provides a new injection scope to its children, optionally extending the surrounding scope with additional providers. Services constructed in this scope are torn down when the Injector unmounts.

Example

<Injector provide={[CounterStore, { provide: API_URL, useValue: '/api' }]}>
<App />
</Injector>