
您可以为每个孩子使用displayName,可通过以下类型进行访问:
for (child in this.props.children){ if (this.props.children[child].type.displayName != 'Card'){ console.log("Warning CardGroup has children that aren't Card components"); } }欢迎分享,转载请注明来源:内存溢出

您可以为每个孩子使用displayName,可通过以下类型进行访问:
for (child in this.props.children){ if (this.props.children[child].type.displayName != 'Card'){ console.log("Warning CardGroup has children that aren't Card components"); } }欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)