I'll be very grateful who can help me with this line I've this: how to load a function when I click on a button because now I have this but it does not work
export var Modulo = React.createClass({ prom1: function () { return( <div> <h1> CONTENT TWO</h1> <span >Para vos bebe</span> <span onClick={this.prom2}> Hasta agotar existencias</span> <span onClick={this.prom3}>Promociones de la hora</span> </div> ) }, prom2: function () { return( <div> <h1> CONTENT TWO</h1> <span onClick={this.prom1}>Para vos bebe</span> <span > Hasta agotar existencias</span> <span onClick={this.prom3}>Promociones de la hora</span> </div> ) }, prom3: function () { return( <div> <h1> CONTENT TREE</h1> <span onClick={this.prom1} >Para vos bebe</span> <span onClick={this.prom2}> Hasta agotar existencias</span> <span>Promociones de la hora</span> </div> ) }, render: function() { return this.prom2(); } }) thanks
renderwill have to call one if those methods. Having one of these methods be called as event handler doesn't make sense. Why wouldrendermagically return what the event handler returns? See the docs: facebook.github.io/react/docs/component-api.html