I am receiving data from server as json data but not a able to display it on the browser i am getting error as
\" Objects are not valid as a React child
JSON.stringify()
convert whole object
into a string
, instead of using this, u can render the specific property of object
. In ur case data object contains 4 keys _id, Id, Name, Age,
so render it like this:
render(){
return(
Name: {this.state.post.data.Name}
Age: {this.state.post.data.Age}
Id: {this.state.post.data.Id}
);
}
By this way you will have a better control on each element, u can apply different styling, formats etc.