React 组件 复合组件

function Name(props){
    return <h1> {props.name} </h1>
}

function Url(props){
    return <h1> {props.url} </h1>
}

function Nickname(props){
    return <h1> {props.nickname} </h1>
}

function App(props){
    return(
    <div>
        <Name name='heson'/>
        <Url url='https://www.cnblogs.com/heson/' />
        <Nickname nickname='renhaizhen' />
    </div>
          )
}

ReactDOM.render(
    <App/>,
    document.getElementById('example')
)

posted @ 2019-12-09 11:06  Heson  阅读(140)  评论(0编辑  收藏  举报
Live2D