SVG use tag and ReactJS

后端 未结 6 1538
慢半拍i
慢半拍i 2020-12-23 00:05

So normally to include most of my SVG icons that require simple styling, I do:


    
         


        
6条回答
  •  一向
    一向 (楼主)
    2020-12-23 00:59

    If you encounter xlink:href, then you can get the equivalent in ReactJS by removing the colon and camelcasing the added text: xlinkHref.

    You'll probably eventually be using other namespace-tags in SVG, like xml:space, etc.. The same rule applies to them (i.e., xml:space becomes xmlSpace).

提交回复
热议问题