Replace UI Component with Component Dependency Injection
Factory
import MapPopoverFactory from 'components/map/map-popover';
import MapControlFactory from 'components/map/map-control';
function MapContainerFactory(MapPopover, MapControl) {
return class MapContainer extends Component {
render() {
return (
<div>
<MapPopover {...popoverProps} />
<MapControl {...controlProps} />
</div>
);
}
}
}
MapContainerFactory.deps = [MapPopoverFactory, MapControlFactory];Recipes
Inject Components
Pass custom component props
Last updated
Was this helpful?