Skip to content

Instantly share code, notes, and snippets.

@deveedutta
Last active December 21, 2016 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deveedutta/59db0c6ff263f53f9a5ee2645e622e6a to your computer and use it in GitHub Desktop.
Save deveedutta/59db0c6ff263f53f9a5ee2645e622e6a to your computer and use it in GitHub Desktop.
custom attributes don't work
<div id="root">
<!-- This element's contents will be replaced with your component. -->
</div>
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')
);
<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