React ignores 'for' attribute of the label element

前端 未结 6 1886
太阳男子
太阳男子 2020-12-02 06:30

In React (Facebook\'s framework), I need to render a label element bound to a text input using the standard for attribute.

e.g. the following JSX is use

6条回答
  •  庸人自扰
    2020-12-02 06:33

    Yes, for react,

    for becomes htmlFor

    class becomes className

    etc.

    see full list of how HTML attributes are changed here:

    https://facebook.github.io/react/docs/dom-elements.html

提交回复
热议问题