Skip to content
Advertisement

React Hooks TypeError: todos is undefined

I am using PERN Stack with bootstrap for styling. So, I want to access my JSON data and show it in the form of todo lists. When I tried using map function I got TypeError: enter image description here

Here is the code:

JavaScript

Advertisement

Answer

I misspelled my variable. So, the problem was I was writing jsonData.data.todos instead off jsonData.data.toDos .

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement