mercredi 20 janvier 2016

onClick="" don't appear at the actual element made with react.

I'm making some elements with react like 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 the actual rendered html page this div does not contain onClick property. Just looks like this.

<div class="addNewTask" data-reactid=".0.2">
  <i class="material-icons"  data-reactid=".0.2.0">add</i>
</div>

How to make it appear?




Aucun commentaire:

Enregistrer un commentaire