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 (
Solution 1:
It won't appear in the rendered HTML, as the handler is attached to the DOM element itself. React also normalizes the event system across browsers so that it behaves consistently. I would suggest reading up on how it works at the official docs: https://facebook.github.io/react/docs/events.html
Solution 2:
Simply put:
onClick
on jsx is notDOM-onClick-event
butReact-onClick-event
.React-onClick-event
is belong to React, so it's not displayed on DOM.- React.js automatically convert
React-onClick-event
intoDOM-onClick-event
behind the scene.
Post a Comment for "OnClick="" Don't Appear At The Actual Element Made With React."