Assume a component receives a nested property in React from its parent :
getDefaultProps: function(){
return ({
"data" : {
"style": {
pieChart: true, // otherwise it'd be a donut chart
radius: 100
},
"series": {
"data": []
}
}
});
},
It's possible to receive a property with some missing values (e.g we may receive series but not style , or we may receive a value for radius but not for pieChart)
How can we define default values only for the missing values ? and keep the rest of values as they are received