Iam trying to write a map function to show all the item in API
ScreenShoot of code to display the items
and this is the console log of the item that fetch from API
I got Error for the map function that isn't working what is the solution
Thank you
CodePudding user response:
It's a little hard to tell from the picture. But if I understood correctly you have no return. Note that you can only have one div in the return.
export default function Feed(props) {
const array1=props.graphDataa.value
return (
<div>
{
postsArr.map(item=> (whatever you want to display...))
}
</div>
CodePudding user response:
- Your div is closed in the opening tag - "taskcolorblack-div"
- You need return value from method listmap like this:
return map1;
- In render function u can call like this
return (<>{listmap().join()}</>)