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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -