2016-08-24 64 views

回答

1
/* document key from this.props is stored in const document 
    & it called destructing object (introduced in es6) */ 

    const {document} = this.props; 

而({document} = this.props)以可變的關鍵文件返回對象。意思是如果您稍後更改文檔值,它也會反映在this.props中(不推薦)。

+0

好的。你是否知道const對應用性能的影響?我想知道是因爲我在列表中創建了很多項目,而這些項目又是'const {document} = this.props;'是否有任何指導原則?使用const的 – MichelH

+0

不會有任何性能影響 – Moniv

相關問題