jsx not working

前端 未结 6 1869
無奈伤痛
無奈伤痛 2020-12-13 03:02

I am using the   tag in jsx and it is not rendering the space. The following is a small snippet of my code.Please help.

var Reporting=React.createCla         


        
6条回答
  •  时光取名叫无心
    2020-12-13 03:44

    {'\u00A0'} works but is hard to read, so I wrapped it in a function component:

    components/nbsp.js:

    export default () => '\u00A0';
    

    usage:

    Helloworld
    
    

提交回复
热议问题