I am new to Reacj.js and cannot get value from function. I am not sure that I am doing it right. I need a func function expression to return "from func" and replace {this.func}. Not sure what I am missing.
var Hello = React.createClass({ func: function(){ return 'from func'; }, render: function() { return <div> <div>Props: {this.props.name}</div> <div>Function: {this.func}</div> </div>; } }); React.render(<Hello name="from props" />, document.getElementById('container'));
I have a js script in http://jsfiddle.net/rexonms/409d46av/
source share