An easy-to-use platform for EEG experimentation in the classroom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 31 lines 760 B view raw
1import * as React from 'react'; 2import { useEffect } from 'react'; 3import { useLocation } from 'react-router-dom'; 4import { useDispatch } from 'react-redux'; 5import { ToastContainer } from 'react-toastify'; 6import TopNav from './TopNavBarContainer'; 7import { RouterActions } from '../actions/routerActions'; 8 9function NavigationTracker() { 10 const location = useLocation(); 11 const dispatch = useDispatch(); 12 useEffect(() => { 13 dispatch(RouterActions.RouteChanged(location.pathname)); 14 }, [location.pathname, dispatch]); 15 return null; 16} 17 18type Props = { 19 children: React.ReactNode; 20}; 21 22export function App(props: Props) { 23 return ( 24 <div> 25 <NavigationTracker /> 26 <TopNav /> 27 {props.children} 28 <ToastContainer /> 29 </div> 30 ); 31}