score:4

Accepted answer
type Props = Readonly<{
    message?: undefined
    a: string
    b: string
} | {
    message: string
    a?: string
    b?: string
}>

const Component = ({ message, a, b}: Props) => <div />;

let c = <Component message="" /> //ok 
let c2 = <Component a="" b="" /> //ok
let c3 = <Component message="" b="" /> //ok 
let c4 = <Component /> //error as expected

Related Query

More Query from same tag