A Pen by Deveedutta on CodePen.
Last active
December 21, 2016 06:46
-
-
Save deveedutta/59db0c6ff263f53f9a5ee2645e622e6a to your computer and use it in GitHub Desktop.
custom attributes don't work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="root"> | |
<!-- This element's contents will be replaced with your component. --> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myAttr = {'custom-attribute': 'I am missing', | |
'data-standard-attribute': 'I present'} | |
let disableFlag = { | |
disabled: true | |
} | |
ReactDOM.render( | |
<button {...myAttr} {...disableFlag} >Hello</button>, | |
document.getElementById('root') | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment