Embedding SVG into ReactJS

后端 未结 6 1219
春和景丽
春和景丽 2020-11-28 03:20

Is is possible to embed SVG markup into a ReactJS component?

render: function() {
  return (
    
      

        
6条回答
  •  时光取名叫无心
    2020-11-28 03:59

    According to a react developer, you dont need the namespace xmlns. If you need the attribute xlink:href you can use xlinkHref from react 0.14

    Example

    Icon = (props) => {
      return 
        
      ;
    }
    

提交回复
热议问题