组件代码:
Class Section extends Component{
render(){
return(<div>
<div className="section">
<div className="content">
</div>
</div>
</div>
)
}
}
App.js代码
Class App extends Component{
render(){
return(
<Section></Section>
<!-- here i need to call the inner or child div which is **content** from the component how can i call that one here -->
)
}
}
我需要多次调用内容div,如何调用那个
提前致谢
答案 0 :(得分:0)
这样的事情会解决你的目的吗?
<强> Content.js 强>
FullName_LastNameFirst
<强> Section.js 强>
Class Content extends Component {
render() {
return (
<div className="content">
{this.props.content}
</div>
)
}
}
<强> App.js 强>
Class Section extends Component{
render(){
return(
<div>
<div className="section">
{this.props.children}
</div>
</div>
)
}
}