Practice
Yes. In the past, React ignored unknown DOM attributes. If you wrote JSX with an attribute that React did not recognise, React would simply skip it. For example, this:
<div mycustomattribute={'something'} />
Would render an empty div to the DOM with React v15:
< div />
In React v16, any unknown attributes end up in the DOM:
<div mycustomattribute='something' />
This is useful for supplying non-standard, browser-specific attributes, for trying out new DOM APIs and for integrating with third-party libraries.
Comments