How to set color to text in React JS

后端 未结 4 1484
伪装坚强ぢ
伪装坚强ぢ 2021-02-19 09:15

I just want to change color of text using style in tag

How can I do that?


4条回答
  •  囚心锁ツ
    2021-02-19 09:57

    You can do it like below :

    Hello world

    React treats style attribute as an object. So we have to provide double quotes "{{ }}" and inside that is our css code. Also the notation should be camel-case. e.g. {{backgroundColor: 'red'}}

提交回复
热议问题