Search code examples
javascriptreactjsreact-propsreact-map-gl

i have run into this error "props map error "


Hi everyone am still learning react by building a dark Mode toggle button that on clicked it changes the mode from light to dark and vice versa. I have ran into a problem when i tried mapping through the state and displaying the data in form of a card(incomplete though)

code structure and the errors

main app component

the Darkmode component


Solution

  • props is an object. map is a method of an array. You probably meant props.individuals.map