Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda