Return multiple elements inside React.render()

后端 未结 5 1160
渐次进展
渐次进展 2020-12-04 21:29

I am new in react and I encountered with this problem:

render: function(){
    return (
        

Account

5条回答
  •  星月不相逢
    2020-12-04 22:26

    There are few options:

    1. Just wrap it up in any

      or
      . render() should return single element.

    2. You can split it up and have multiple components which implement some dedicated logic which is better and used to be a good practice in React

提交回复
热议问题