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 array. This is how the it looks.
1:
[
Object {
"ClassId":232,
"Teacher":"TeacherName"
...
}
Object {
"ClassId":21,
"Teacher":"TeacherName"
...
}
...
]
This is the code I have right now but somehow the component does not render to the screen.
timetable[key]["value"]. The value field is there because the actual value for a key is another dictionary, but I'm only using the value. Printing the elements in the console instead of passing them as props to the CourseCard component looks good, the data is there.
{Object.keys(timetable).map((key, index) => {
timetable[key]["value"].map(iter => {
return (
<CourseCard
teacher={iter["Teacher"]}
course={iter["ClassName"]}
classRoom={iter["ClassRoom"]}
time={iter["Time"]}
key={iter["Key"]}
/>
);
});
})}