This is the use case: A component TableGroup
should require a user to specify data
property which is an array of objects to be rendered in the table or requestDataUrl
property from where the component will get that array of objects. In short, one of these two properties is required but not both. How could I achieve that in the following component.propTypes
object?
TableGroup.propTypes = {
fieldNames: React.PropTypes.array.isRequired,
dataFields: React.PropTypes.array.isRequired,
uniqueField: React.PropTypes.string.isRequired,
data: React.PropTypes.array,
requestUrlSource: http://someurl/api/resource
}
requestUrlSource
ordata
. Only one of these should be required. But not the both. @NagaSaiA – Subjacent