I have a track prop with the following definition:
propTypes: {
track: React.PropTypes.shape({
cover: React.PropTypes.string,
title: React.PropTypes.string,
artist: React.PropTypes.string
})
}
I would like the track.cover to get a default value if undefined:
getDefaultProps: function() {
return {
track: {
cover: 'placeholder.png'
}
}
}
Any chance I can do that at the view level?
Does getDefaultProps does a Deep Merge?
Or do I need to handle this at the model level?
Thanks