In 10.0.0-alpha.2, state does not set properly from componentWillMount. It seems this has been experienced by others in the past in componentWillReceiveProps. Here's a simple test case:
export class TestComponent extends Component {
//This does not work:
componentWillMount() {
this.setState({message:"componentWillMount"});
}
/*
//This works:
componentDidMount() {
this.setState({message:"componentDidMount"});
}
*/
render() {
return <p>State came through from {this.state.message || 'nothing =('}</p>;
}
}
In 10.0.0-alpha.2, state does not set properly from
componentWillMount. It seems this has been experienced by others in the past incomponentWillReceiveProps. Here's a simple test case: