Apply React constructor in componentDidMount

See inline comments.