How to render accents in ReactJs?

后端 未结 3 1406
陌清茗
陌清茗 2020-12-20 23:27

I\'m trying render an element which has an accent character using ReactJS and JSX, but it\'s not returning what I wanted.

My JSX:

var Or         


        
3条回答
  •  星月不相逢
    2020-12-21 00:25

    Also using the charset utf-8, try using this library: https://github.com/mathiasbynens/he

    import { decode } from 'he';
    
    class Post extends Component { 
      render() {
        

    { decode(this.props.post.title) }

    } }

提交回复
热议问题