When using this
on react class component like this:
someFunc() {
console.log(this.props.someProp);
}
I get undefined
.
But when I use this
inside a lifecycle method of react like this:
componentDidMount() {
console.log(this.props.someProp);
}
I get the value of someProp
.
I'm searching for an explanation for this behavior, can someone help?