Functions are not valid as a React child. This may happen if you return a Component instead of from render

后端 未结 8 2237
醉话见心
醉话见心 2020-12-04 20:54

I have written a Higher Order Component:

import React from \'react\';


const NewHOC = (PassedComponent) => {
    return class extends React.Component {
          


        
8条回答
  •  -上瘾入骨i
    2020-12-04 21:39

    What would be wrong with doing;

    {i.title}
    [/*Use IIFE */] {(function () { if (child.children && child.children.length !== 0) { let menu = createMenu(child.children); console.log("nested menu", menu); return menu; } })()}

提交回复
热议问题