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:
onClickon jsx is notDOM-onClick-eventbutReact-onClick-event.React-onClick-eventis belong to React, so it's not displayed on DOM.- React.js automatically convert
React-onClick-eventintoDOM-onClick-eventbehind the scene.
Post a Comment for "OnClick="" Don't Appear At The Actual Element Made With React."