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

174
Visualizações
Uncaught TypeError: Cannot read properties of undefined (reading 'toString')

I am developing a React app and I don't know how to solve this error. I'm pretty sure it's from my useEffect function, but I can't figure out what's wrong. Any help would be much appreciated, thank you!

const CourseTypeFour = ({ data, classes, bgWhite }) => {
   let { id } = data;
   const [courseObject, setCourseObject] = useState({});

   useEffect(() => {
        axios.get(`http://localhost:3001/courses/${id}`).then((response) => {
          setCourseObject(response.data);
        });
    },[id]);

   return (
      ...
   )
}
export default CourseTypeFour;
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The problem isn't in this part of the code. In error, you can see that problem is when you try to use the toString method on a variable that is undefined. Try to find part of the code where you use the toString method, and before it execute the console.log function with this variable to see what is inside.

about 4 years ago · Juan Pablo Isaza Relatório
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