I try to learn React but seems in the new version there are some changes:
class Reactapp extends React.Component{ constructor(){ super(); } sayMassage(){ console.log(this.props.children); } render(){ var sayMassage = this.sayMassage.bind(this); return( <div> <h3> Hello {this.props.word}</h3> <p> <a href="#" onClick={this.sayMassage}> Click Me </a> </p>; </div> ); } } ReactDOM.render( <div> <Reactapp word="React">This is a ReactJS 15.5 Tutorial</Reactapp> </div>, document.getElementById('root') ); This code should work but seems I am missing something. It should console.log "This is a ReactJS 15.5 Tutorial" super is called before this so this could not be null.
I tried to bind this but I don't know how, My code seems to fail. The old code with createReactClass had auto-binding tho.