React 生命週期

React 生命週期 9 步 初始化階段 1. constructor() constructor參數接受兩個參數props,context 可以獲取到父組件傳下來的的props,context,如果你想在constructor構造函數內部使用props或context,則需要傳入,並傳入super對象。而且super()是必須要寫的,否則constrctor內部的this指向會報錯 constr
相關文章
相關標籤/搜索