This is my file Structure
./src
./components
Tabnav.js
CharacterList.js
App.js
In my App.js file, I used Axios to fetch data from an Api, then I returned the 'CharacterList' component, passing it the properties gotten from the fetch results.
In my CharacterList component, I received the data from App.js through props and mapped over it to populate a list of the result I got. It worked fine and displays accurately.
In my Tabnav component I imported Route and while passing the CharacterList component to Route like this <Route path="/characters" component={CharacterList} />
I receive a TypeError: Cannot read property 'map' of undefined
whenever I click on the link.
Without Route my data displays fine but with Route it returns 'map' error. What is going on here please and how can I solve this issue?
Thanks!