import React from 'react' ; import dynamic from 'dva/dynamic' ; import { Route } from 'dva/router' ; export function mapRouteMethod ( routeArr ) { return routeArr . map ( ( { path , component , exact = true } ) => { return ( < Route key = { path } path = { path } exact = { exact } component = { dynamic ( { component , } ) } / > ) ; } ) ; }