React - expressions must have one parent element?

后端 未结 7 1428
再見小時候
再見小時候 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 03:07

    Put them in an array (assign the keys also):

    { if.this.props.mail ? 
        [
            ,
            
        ]
    : null }
    

    With latest React version, you can try React.Fragment also, like this:

    { if.this.props.mail ? 
        
            ,
            
        
    : null }
    

提交回复
热议问题