React 多组件传值props和this
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="js/react.js"></script>
<script src="js/react-dom.js"></script>
<script src="js/browser.min.js"></script>
</head>
<body>
<div +value);
this.result = value;
},
get:function(){
return this.result;
},
render:function(){
return <div>
<AComponent funcSave={this.save}/>
<BComponent funcGet={this.get} name='获取输入的值'/>
</div>
}
})
ReactDOM.render(
<MainComponent/>,
document.getElementById('example')
)
</script>
</body>
</html>
以上是 React 多组件传值props和this 的全部内容, 来源链接: utcz.com/z/382082.html