React - expressions must have one parent element?

后端 未结 7 1446
再見小時候
再見小時候 2020-11-30 02:02

I\'m relatively new to React and I\'m wondering what\'s the standard here.

Imagine I have a react-router like this one:



        
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-30 02:55

    You must been use a fragment tag e.g(div, <>,...).

    Check this short solution:

    { if.this.props.mail ? 
     <>
       
       
     
     : null }
    

提交回复
热议问题