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

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -