jsx not working

前端 未结 6 1909
無奈伤痛
無奈伤痛 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:38

    Write your jsx code wrapped in { } as shown below.

    Code {' '}

    You can put space or any special character here.

    e.g in your case

    Select Takeout Scenario: 
    

    should be like this

    Select Takeout Scenario:{' '}
    

    It will work.

    As Advice you should not use   to add extra space, you can use css to achieve same.

提交回复
热议问题