Say I have the following condition:
static propTypes = {
deployment: PropTypes.shape({
getMetrics: PropTypes.func.isRequired,
getRootMetric: PropTypes.func.isRequired
}).isRequired,
}
How would I declare the default
for deployment ? Would it be undefined or would it be [] ?
Since the prop is required, I see no reason to define a default. Defaults are only useful for optional props which also have a reasonable default value, such as an empty list []
or an empty object {}
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments