I'm getting a data in my react component props which is all of same type but different variables.
Is there any way so I can just need to define all the type variable in one line.
interface IcarouselProps {
img1: string
img2: string
img3: string
img4: string
img5: string
img6: string
heading1: string,
heading2: string,
heading3: string,
heading4: string,
heading5: string,
heading6: string,
}
[key: string]: stringif you just want a dictionary, but it won't assure you that you have keys in the form of img{x} and header{x}