I have default props in my React component:
PropertyTitleLabel.defaultProps = {
bedrooms: 1,
propertyType: \'flat\'
};
PropertyTitleLabel.propTypes =
undefined
= nothing.null
= something that hints "nothing".undefined
doesn't exist in reality. null
however does exist. This means undefined
won't pass a prop value as you cannot pass something which doesn't exist. Since null
is not nothing, but rather is something which only hints at nothing, it passes in props.