When I render this in ReactJS, I get the error: "Objects are not valid as a React child (found: object with keys {Source, Value}). If you meant to render a collection of children, use an array instead.". But in my initial state, I init the key "list_ratings" as an array.
// this is in my constructor method
this.state = {list_ratings: []}
// this is somewhere else in my code
let movieRatings = [
{"Source": "IMDB", "Value": "8"},
{"Source": "GDN", "Value": "6"},
{"Source": "The times", "Value": "7"}
];
this.setState({
list_ratings: movieRatings
});
How can I solve this?
I render the list of ratings as follows:
<p>{this.state.list_ratings}</p>