init commit
This commit is contained in:
21
src/App.tsx
Normal file
21
src/App.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import "./App.css";
|
||||
import Timetable from "./components/Timetable/Timetable";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { fetchTimetable } from "./store/index";
|
||||
import { useEffect } from "react";
|
||||
import { type AppDispatch } from "./store/index";
|
||||
|
||||
function App() {
|
||||
const dispatch = useDispatch<AppDispatch>();
|
||||
// Fetch the timetable data when the app loads
|
||||
useEffect(() => {
|
||||
dispatch(fetchTimetable());
|
||||
}, [dispatch]);
|
||||
return (
|
||||
<>
|
||||
<Timetable />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
Reference in New Issue
Block a user