I'm new to react and all of its components and stuff, and im following a youtube video where the code is like this. I get an error with the "checked: session.checked" line where checked is undefined. I have no idea how to fix this and ive been searching all over the web trying to find an answer. Do any of you know what the problem is?
//pages
import Home from './pages/Home'
import Login from './pages/Login'
import Signup from './pages/Signup'
import Dashboard from './pages/Dashboard'
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import './scss/base.css';
import { StyledContainer } from './components/Styles'
import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";
import AuthRoute from './components/AuthRoute.js';
import BasicRoute from './components/BasicRoute.js';
import { connect } from 'react-redux';
function App({ checked }) {
return (
<Router>
{checked && (
<StyledContainer>
<Routes>
<AuthRoute exact path="/" element={<Home />} />
<AuthRoute exact path="/dashboard" element={<Dashboard />} />
<BasicRoute exact path="/login" element={<Login />} />
<BasicRoute exact path="/signup" element={<Signup />} />
</Routes>
</StyledContainer>
)}
</Router>
);
}
const mapStateToProps = ({ session }) => ({
checked: session.checked
});
export default connect(mapStateToProps)(App);
The video im following is https://www.youtube.com/watch?v=HCnHYz6TXA4&list=PLk8gdrb2DmChrL50moKeFNAVnFqZ3GLF7&index=6, and its 1h and 52m in when i get the issue