0

I have the following interface:

export interface BlockCtaDoubleProps
{
    subheadline: string;
    headline: string;
    button: string;
    link: string;
    subheadlineLeft?: string;
    headlineLeft?: string;
    buttonLeft?: string;
    image?: string;
    alt?: string;
}

Image & alt can only exit if there's no ...Left props and vice versa. How can I make this clear with interfaces to prevent disparities?

Johnny Kontrolletti
  • 727
  • 1
  • 10
  • 22

1 Answers1

0

Check this post. It explains how to conditionally allow either one of the many or at absolutely either one out many property to be present in interface.