Component Not Rendering Inside Map Function-react Native
So, I have a dictionary with keys and an array of Objects as values for each key. What I need to do is render a new component with props coming from Object for each element of the
Solution 1:
You need to return the result of inner map function,
{Object.keys(timetable).map((key, index) => {
return timetable[key]["value"].map(iter => {
return (
<CourseCard
teacher={iter["Teacher"]}
course={iter["ClassName"]}
classRoom={iter["ClassRoom"]}
time={iter["Time"]}
key={iter["Key"]}
/>
);
});
})}
Post a Comment for "Component Not Rendering Inside Map Function-react Native"