我创建了一个React组件(以下称为buildscript {
dependencies {
classpath 'com.google.gms:google-services:4.1.0' //decreased from 4.2.0
}
}
),该组件将子级和一组标签作为道具。其用法如下:
Parent
我希望数组中的标签数等于该组件接受的子级数。
强制执行此要求的方法是什么?我想到的一些方法是使用PropTypes,console.assert或引发异常。