Created
February 3, 2017 07:36
-
-
Save srph/865569a84f6aa3626ba31eb47acda4d3 to your computer and use it in GitHub Desktop.
React: html entity component. Because Buble won't let me use html entities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| const Entity = ({char}) => | |
| <span dangerouslySetInnerHTML={{ __html: `&${char};` }} /> | |
| Entity.propTypes = { | |
| char: React.PropTypes.string.isRequired | |
| }; | |
| export default Entity; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment