I'm trying to improve the quality of my app with PropTypes and I've stuck in this scenario:
const withLayout = (customProps) => (PageComponent) => (props) => {
const { locale } = props.pageContext;
const {
localeKey, hideLangs, headerTitle, headerSubtitle, headerImages,
} = customProps;
....
}
And this probably will not make any sense.
withLayout.propTypes = {
pageContext: PropTypes.string.isRequired,
};
How can I assign PropTypes to this? Do I have to deconstruct it into three named functions?