Is it possible to define a type for an object's with a required key value pair and a default key value pair?
Example:
const myComponent = (props) => {
const {
myObject: {
someRequiredString,
someNotRequiredString,
}
}
}
myComponent.propTypes = {
myObject: PropTypes.shape({
someRequiredString.string.isRequired,
}).isRequired,
}
myComponent.defaultProps = {
myObject: {
someNotRequiredString: '',
}
}