0
点赞
收藏
分享

微信扫一扫

Log:2021-12-02

止止_8fc8 2022-07-27 阅读 146


1.学习{props.children}的用法

function ChildComponent(props){
return (
<div>
{props.children}
</div>
);
}

function ParentComponent() {
return (
<ChildComponent>
<h1>abcd</h1>
<h2>efgh</h2>
</ChildComponent>

);
}

ReactDOM.render(
<ParentComponent />,
document.getElementById('root')
);


举报

相关推荐

0 条评论