2016-08-24 6 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;'という指針がありますか? – MichelH

+0

constを使用してもパフォーマンスに影響はありません – Moniv

関連する問題