function loadComponents(context, item, dispatch) {
	/* eslint no-param-reassign: ["error", { "props": false }] */
	if (item.component) {
		// we create an HOC to pass item.componentId
		item.component = withProps(cmf.component.get(item.component, context), item);
	}
	if (item.components) {
		// TODO: iterate over all keys to call loadComponents
	}
	if (item.getComponent) {
		item.getComponent = getFunction(item.getComponent, context);
	}
	if (item.getComponents) {
		item.getComponents = getFunction(item.getComponents, context);
	}
	if (item.onEnter) {
		const onEnterFn = getFunction(item.onEnter, context);
		item.onEnter = function onEnter(nextState, replace) {
			return onEnterFn({
				router: {
					nextState,
					replace,
				},
				dispatch,
			});
		};
	}
	if (item.onLeave) {
		const onLeaveFn = getFunction(item.onLeave, context);
		item.onLeave = function onLeave(nextState, replace) {
			return onLeaveFn({
				router: {
					nextState,
					replace,
				},
				dispatch,
			});
		};
	}
	if (item.childRoutes) {
		item.childRoutes.forEach(route => loadComponents(context, route, dispatch));
	}
	if (item.indexRoute) {
		loadComponents(context, item.indexRoute, dispatch);
	}
}
/**
 * Internal. Is here to replace all 'component' from an object by their
 * value in the registry. It configures react-router
 * @param  {object} context The react context
 * @param  {object} item The route to adapt
 * @param  {object} dispatch The redux dispatcher
 */
Internal. Is here to replace all 'component' from an object by their
value in the registry. It configures react-router
@param  {object} context The react context
@param  {object} item The route to adapt
@param  {object} dispatch The redux dispatcher
Internal . Is here to replace all ' component ' from an object by their value in the registry . It configures react - router @param { object } context The react context @param { object } item The route to adapt @param { object } dispatch The redux dispatcher
function loadComponents(context, item, dispatch) {
	if (item.component) {
		item.component = withProps(cmf.component.get(item.component, context), item);
	}
	if (item.components) {
	}
	if (item.getComponent) {
		item.getComponent = getFunction(item.getComponent, context);
	}
	if (item.getComponents) {
		item.getComponents = getFunction(item.getComponents, context);
	}
	if (item.onEnter) {
		const onEnterFn = getFunction(item.onEnter, context);
		item.onEnter = function onEnter(nextState, replace) {
			return onEnterFn({
				router: {
					nextState,
					replace,
				},
				dispatch,
			});
		};
	}
	if (item.onLeave) {
		const onLeaveFn = getFunction(item.onLeave, context);
		item.onLeave = function onLeave(nextState, replace) {
			return onLeaveFn({
				router: {
					nextState,
					replace,
				},
				dispatch,
			});
		};
	}
	if (item.childRoutes) {
		item.childRoutes.forEach(route => loadComponents(context, route, dispatch));
	}
	if (item.indexRoute) {
		loadComponents(context, item.indexRoute, dispatch);
	}
}
function loadComponents ( context , item , dispatch ) { if ( item . component ) { item . component = withProps ( cmf . component . get ( item . component , context ) , item ) ; } if ( item . components ) { } if ( item . getComponent ) { item . getComponent = getFunction ( item . getComponent , context ) ; } if ( item . getComponents ) { item . getComponents = getFunction ( item . getComponents , context ) ; } if ( item . onEnter ) { const onEnterFn = getFunction ( item . onEnter , context ) ; item . onEnter = function onEnter ( nextState , replace ) { return onEnterFn ( { router : { nextState , replace , } , dispatch , } ) ; } ; } if ( item . onLeave ) { const onLeaveFn = getFunction ( item . onLeave , context ) ; item . onLeave = function onLeave ( nextState , replace ) { return onLeaveFn ( { router : { nextState , replace , } , dispatch , } ) ; } ; } if ( item . childRoutes ) { item . childRoutes . forEach ( route => loadComponents ( context , route , dispatch ) ) ; } if ( item . indexRoute ) { loadComponents ( context , item . indexRoute , dispatch ) ; } }
Internal.
Internal .
/* eslint no-param-reassign: ["error", { "props": false }] */ // we create an HOC to pass item.componentId // TODO: iterate over all keys to call loadComponents