True custom attributes (e.g. Microdata) in React

后端 未结 5 1790
渐次进展
渐次进展 2020-12-09 16:57

The site I am developing makes use of Microdata (using schema.org). As we are shifting development over to use React to render our views I have hit a blocker where React wil

5条回答
  •  再見小時候
    2020-12-09 17:22

    It looks like these non-standard properties have been added to React

    itemProp: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
    itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, // Microdata: http://schema.org/docs/gs.html
    itemType: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
    

    Note that properties have capital letter in the middle:

    will generate proper lowercase attributes as result.

提交回复
热议问题