when i initialize my state
constructor(props) {
super(props);
this.state = {
restaurant:this.props.restaurant
}
}
console.log(this.state.restaurant)
returns:
[]
"this.props.restaurant" contains data
i need to get the data from props (before rendering) to display them on a table otherwise my table will be empty