When I see people post stuff like this, I have a presumption they think they are above everyone without considering maybe there is a reason behind . Like some others pointed out below, condition might have different cases and dev might be looking for true case.
const MyComponent = ({someVar, ...others}) => {
let config = {};
if( !someVar) {
Object.assign(config, {...others});
} else if (someVar === true ) {
Object.assign(config, {x: 54, y: 54})
}
else {
Object.assign(config, {someVar, ...others})
}
return (
<AnotherComponent {...config}>
);
}
MyComponent.propTypes = {
someVar: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.shape({ x: PropTypes.number, y: PropTypes.number})
]),
......
}