2016-10-31 8 views
0

これは正しい使い方ですか? "this.props.children.props.children"?this.props.childrenがこのコンポーネントを返すのはなぜですか?

{ React.cloneElement(this.props.children.props.children, this.props) } 

this.props.childrenはこのコンポーネントを示します。私が忘れたのは何ですか?

React.cloneElement(this.props.children、this.props:

はESLintは '子どもたちが' 小道具の検証に欠けているが、私は、私はこれを使用して私のために正常に動作します

myClass.protoType = { 
    children: React.PropTypes.element.isRequired 
}; 
+0

あなたが '{React.cloneElement(this.props.children.props.children、this.props)}'によって何をしようとしているのかを説明します。さもなければ、それは 'protoType'ではなく 'propTypes' –

+0

@DamienLeroux Thxそれは私の間違いでした – Ortee

答えて

0

を持っている期待しました);

関連する問題