Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 反应嵌套组件呈现问题_Reactjs - Fatal编程技术网

Reactjs 反应嵌套组件呈现问题

Reactjs 反应嵌套组件呈现问题,reactjs,Reactjs,这是我的密码 const Parent = (props) => <div> {props.children} </div> it works: <Parent> <a href="/google">Click here </a> </Parent> This doesn't work <Parent> <Abutton /> </Parent> const Abu

这是我的密码

const Parent = (props) => <div> {props.children} </div>

it works: 

<Parent> <a href="/google">Click here </a> </Parent> 


This doesn't work 
<Parent> <Abutton /> </Parent> 

const Abutton = (props) => <a href="/google">Click here </a>
  • 您错误地添加了
    而不是
    来关闭标记
  • const Parent=(props)=>{props.children}
    
  • 
    ReactDOM.render(
    ,
    文件正文
    );
    
    
    
    您缺少一个
    /
    用于编辑语法的
    您的代码中有一个拼写错误
    Abutton
    缺少自动关闭标签的
    /
    Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) 
    
    const Parent = (props) => <div> {props.children} </div>