Per the title, why does the initial this.props fail? And more practically, how do you work around this in cases where you rely on the props within your constructor? For instance I would like to reference props within my subscriptions?
class AboutBox extends Component {
static defaultProps = {
title: 'Undefined Product',
}
constructor() {
super();
console.log(this.props.title); //this fails (=> null)
}
render() {
console.log(this.props.title); //this works (=> 'Undefined Product')
return null;
}
}