I want to centralize proptypes that might contain different properties and be or not required. As an example:
Component A has:
roomData: PropTypes.shape({
roomId: PropTypes.number,
roomType: PropTypes.string,
}).isRequired,
while Component B has:
roomData: PropTypes.shape({
roomId: PropTypes.number.isRequired,
roomType: PropTypes.string.isRequired,
game: PropTypes.shape({
gameId: PropTypes.number.isRequired,
drawDescription: PropTypes.string.isRequired,
}).isRequired,
}),
If both are COMPLETELY the same, I know how to do it. The problem is about them being different.