old_contents: import {createRoutesFromReactChildren} from 'react-router';
  import React from 'react';
  
  import Util from './Util';
  
  const RouterUtil = {
  
    /**
     * Creates a tree of React components for an array of route configurations
     *
     * @param  {Array} routes
     * @return {Array} React tree of routes
     */
    createComponentsFromRoutes(routes) {
      return routes.map(function (route) {
        let args = [route.type, Util.omit(route, ['type', 'children'])];
  
        if (route.children) {
          let children = RouterUtil.createComponentsFromRoutes(route.children);
          args = args.concat(children);
        }
  
        return React.createElement(...args);
      });
    },
  
    /**
     * Sets missing configuration properties to the routes that are generated by
     * react router. This is needed because react router will strip those out.¡
     *
     * @param  {Array} routes of Route instances
     * @param  {Array} originalRoutes of original route configuration
     * @return {Array} Modified routes with original configuration
     */
    setRouteConfiguration(routes, originalRoutes) {
      return routes.map(function (route, index) {
        let originalConfiguration = originalRoutes[index];
  
        if (!originalConfiguration) {
          return route;
        }
  
        if (route.childRoutes && originalConfiguration.children) {
          route.childRoutes = RouterUtil.setRouteConfiguration(
            route.childRoutes, originalConfiguration.children
          );
        }
  
        if (originalConfiguration.buildBreadCrumb) {
          route.buildBreadCrumb = originalConfiguration.buildBreadCrumb;
        }
  
        return route;
      });
    },
  
    /**
     * Builds a route array that react router can use,
     * with the correct configuration.
     *
     * @param  {Array} originalRoutes Original Route configuration
     * @return {Array} Routes ready to use by react router
     */
    buildRoutes(originalRoutes) {
      let elementRoutes = RouterUtil.createComponentsFromRoutes(originalRoutes);
      let routes = createRoutesFromReactChildren(elementRoutes[0]);
  
      return RouterUtil.setRouteConfiguration(routes, originalRoutes);
    }
  
  };
  
  module.exports = RouterUtil;
  
new_contents: import {createRoutesFromReactChildren} from 'react-router';
  import React from 'react';
  
  import Util from './Util';
  
  const RouterUtil = {
  
    /**
     * Creates a tree of React components for an array of route configurations
     *
     * @param  {Array} routes
     * @return {Array} React tree of routes
     */
    createComponentsFromRoutes(routes) {
      return routes.map(function (route) {
        let args = [route.type, Util.omit(route, ['type', 'children'])];
  
        if (route.children) {
          let children = RouterUtil.createComponentsFromRoutes(route.children);
          args = args.concat(children);
        }
  
        return React.createElement(...args);
      });
    },
  
    /**
     * Sets missing configuration properties to the routes that are generated by
     * react router. This is needed because react router will strip those out.¡
     *
     * @param  {Array} routes of Route instances
     * @param  {Array} originalRoutes of original route configuration
     * @return {Array} Modified routes with original configuration
     */
    setRouteConfiguration(routes, originalRoutes) {
      return routes.map(function (route, index) {
        let originalConfiguration = originalRoutes[index];
  
        if (!originalConfiguration) {
          return route;
        }
  
        if (route.childRoutes && originalConfiguration.children) {
          route.childRoutes = RouterUtil.setRouteConfiguration(
            route.childRoutes, originalConfiguration.children
          );
        }
  
        // Transfer any property that is not already present on route,
        // but available in originalConfiguration
        Object.keys(originalConfiguration).forEach(function (prop) {
          if (!route.hasOwnProperty(prop)) {
            route[prop] = originalConfiguration[prop];
          }
        });
  
        return route;
      });
    },
  
    /**
     * Builds a route array that react router can use,
     * with the correct configuration.
     *
     * @param  {Array} originalRoutes Original Route configuration
     * @return {Array} Routes ready to use by react router
     */
    buildRoutes(originalRoutes) {
      let elementRoutes = RouterUtil.createComponentsFromRoutes(originalRoutes);
      let routes = createRoutesFromReactChildren(elementRoutes[0]);
  
      return RouterUtil.setRouteConfiguration(routes, originalRoutes);
    }
  
  };
  
  module.exports = RouterUtil;
  
subject: Make routes take any property, that is not already present