javascript - onClick="" don't appear at the actual element made with react. -
i'm making elements react this:
var addnewtask = react.createclass({ handleclick: function() { console.log('pressed!'); }, render: function() { return ( <div classname="addnewtask" onclick={this.handleclick}> <i classname="material-icons">add</i> </div> ); } });
but on actual rendered html page div not contain onclick property. looks this.
<div class="addnewtask" data-reactid=".0.2"> <i class="material-icons" data-reactid=".0.2.0">add</i> </div>
how make appear?
it won't appear in rendered html, handler attached dom element itself. react normalizes event system across browsers behaves consistently. suggest reading on how works @ official docs: https://facebook.github.io/react/docs/events.html
Comments
Post a Comment