render () { const { match, history } = this.props return ( <> <Switch> <Route path={`${match.path}/:id`} render={({ match }) => ( <LayoutGroup title='Edit Employee'> <EmployeeForm key='edit' id={match.params.id} history={history} /> </LayoutGroup> )} /> <Route exact path={`${match.path}/`} render={() => ( <LayoutGroup title='Employees'> <EmployeeForm key='add' /> <DataList name='employees' selector={getAllEmployees} actions={{ remove: removeEmployee, setSortState }} TEMPLATE={TEMPLATES.employees} /> </LayoutGroup> )} /> </Switch> </> ) }