0
const {document} = this.props
と({document} = this.props)
の違いは何ですか?私は多くの場合にconst {document} = this.props
を使用しています。それがアプリのパフォーマンスに悪いのだろうか?const {document} = this.propsと({document} = this.props)の違いは何ですか
const {document} = this.props
と({document} = this.props)
の違いは何ですか?私は多くの場合にconst {document} = this.props
を使用しています。それがアプリのパフォーマンスに悪いのだろうか?const {document} = this.propsと({document} = this.props)の違いは何ですか
/* 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にも反映されます(推奨されません)。
大丈夫です。あなたはconstがアプリケーションのパフォーマンスに及ぼす影響を知っていますか?リスト内にたくさんのアイテムを作成しているので、これは 'const {document} = this.props;'という指針がありますか? – MichelH
constを使用してもパフォーマンスに影響はありません – Moniv