Diff算法
react
node_modules:安裝的所有依賴的模塊
package.json:自定義項目的基本信息
public中的index.html:渲染模板
meat標簽引入的主頁一個自適應(yīng)的viewport聲明
link標簽引入項目基本配置文件anifest.json和圖標
react渲染div
react ES6語法
constructor(props){
super(props);
this.state={opacity:1.0};
}
react 基礎(chǔ)
componentWillMount
render:根據(jù)props和state返回一個react元素,不負責渲染,不能執(zhí)行任何副作用,如狀態(tài)的改變。
componentDidMount:this.getDOMNode()調(diào)用,this.setState渲染
componengtWillRecriveProps(nextProps):nextProps新傳進來的參數(shù)。調(diào)用setState,this.state更新后的
shouleComponentUpdate(nextProps,nexyState):不能調(diào)用setState
componentWillUpdate(nextProps,nextState):不能調(diào)用setState
render
componentDidUpdate(prevProps,prevState)
componentWillUnmount
props:
<Component data="測試props"/>
Component組件中this.props.data可取得data中的值 單值傳遞,多值傳遞,父向子傳遞