myxvisual / react-uwp

📱⌨ React Components that Implement Microsoft's UWP Design & Fluent Design.
https://react-uwp.com
MIT License
1.18k stars 78 forks source link

About source code of icon component #80

Open tc9011 opened 5 years ago

tc9011 commented 5 years ago

Hi, myxvisual

I read the source code of this project recently. And I have a question about icon component, what the difference between text and span to render icon ?

<PseudoClasses
        {...attributes}
        onMouseEnter={this.handleMouseEnter}
        onMouseLeave={this.handleMouseLeave}
        {...styleClasses}
      >
        {useSVGElement ? (
          <text>{icon}</text>
        ) : (
          <span>{icon}</span>
        )}
</PseudoClasses>