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