Elliot Yang 的动态
动态详情
返回列表
Elliot Yang
React v16 support custom DOM attributes.
In the past, React used to ignore unknown DOM attributes. If you wrote JSX with an attribute that React doesn't recognize, React would just skip it.
For example, let's take a look at the below attribute:
1<div mycustomattribute={'something'} />Would render an empty div to the DOM with React v15:
1<div />In React v16 any unknown attributes will end up in the DOM:
1<div mycustomattribute='something' />浏览:233点赞:0