Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

462
Visualizações
The above error occurred in the <Connect(App)> component:

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

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda