React Javascript displaying/decoding unicode characters

后端 未结 5 1439
日久生厌
日久生厌 2021-01-03 20:13

I have a string in unicode that i need to convert. I need to render the string with \\u00f3 to ó. This is an example, it should happen with all other types of characters, á

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-03 20:46

    React converts unicode automatically with the dangerouslySetInnerHTML attribute.

    See for more info: https://reactjs.org/docs/dom-elements.html

    export default class Hello extends Component {
    
    render() {
        return (
            
    ); } }

提交回复
热议问题