type GeneralType = { item1?: string; item2: number; }; const GeneralComponent = (props: GeneralType) => { if (props.item1) { return <ComponentA {...props} /> } else { return <ComponentB {...props} /> } }