JSFiddle - React, Tailwind, and code Playground

by igalst

Babel + JSX

const routes = {
	directorship: DirectorshipInnerAppComponent,
  testResults: TestsResultsInnerAppComponent,
  ....
};

<Switch>
	{Object.entries(routes).map(([key, Component]) => (
  	<Route path={`/${key}/**`} render={props => 
    	<Component {...allPropsHere} {...props}/>
    }/>
  ))}
</Switch>