I have the following Object (after some dot operating inside) I called it props.stuff , Given: data is passed from Parent component to child as
//Parent
componentDidMount() {
this.getData();
}
async getData() {
const res = await axios.get(
"{link here}"
);
const { data } = await res;
this.setState({ stuff: data});
}
<Child props={this.state.stuff} />
so, in Child when I do console.log(props.stuff)
:
props.stuff= {
"date":"November 14",
"status":"PENDING",
"id":"146859",
"invoice_number":"123685479624",
"amount":"950.00",
"currency":"$"
}
But trying to access props.stuff.date ( or anything like props.stuff.{element} ) gives me undefined. What am I doing wrong?
NOTE: I got the string below by doing console.log(JSON.stringify(props.stuff)) so this is exactly what it is.