import React , { useEffect } from 'react' ; import { Route , Switch } from 'react-router-dom' ; import { useActions } from 'kea' ; import { GROUP_PATH , GROUPS_PATH } from '../../routes' ; import { GroupRouter } from './group_router' ; import { Groups } from './groups' ; import { GroupsLogic } from './groups_logic' ; import './groups.scss' ; export const GroupsRouter = ( ) => { const { initializeGroups } = useActions ( GroupsLogic ) ; useEffect ( ( ) => { initializeGroups ( ) ; } , [ ] ) ; return ( < Switch > < Route exact path = { GROUPS_PATH } > < Groups /> < /Route> < Route path = { GROUP_PATH } > < GroupRouter /> < /Route> < /Switch>); } ;