A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object

后端 未结 4 1686
清歌不尽
清歌不尽 2020-12-20 14:13

I\'m just new in ReactJS and I have a problem. I can\'t solve it. It seems everything is all right, but still console puts me:

A valid React element

4条回答
  •  渐次进展
    2020-12-20 15:12

    When you are using ES6 syntax's make sure you do the following

    const App = ()=> (
      

    Adam

    Alex

    )

    Here the "()" is important and it says the bracketed is the jsx returned

    If you are having a single line return then you can do this

    const App = ()=> 

    Hello

提交回复
热议问题