1. 键值对
<ClaaNameA name = “Tom” /> <ClaaNameA name = {Tom} /> <ClaaNameA name = {“Tom”} /> <ClaaNameA name = {[1,2,3]} />//数组 <ClaaNameA name = {FunctionNAme} /> //定义一个函数
2. 展开属性
<ClassNameB {…props} />
其中props是一个对象:
var props = { name: 'mengff', age: 30 }
3. setProps方法从外表设置属性
var component = React.render('<ClassNameC></ClassNameC>',document.body); component.setProps({name:'mengff'});
出处:https://www.cnblogs.com/daomul/p/4853637.html