Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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