Say I have an array like so:
[
{ id: 1, component: "mockup", src: "some-link" },
{ id: 2, component: "header", title: "Some Title", subtitle: "Lorem ipsum..." }
]
I am supposed to render according to the component key's value. How can I tell typescript to expect additional attributes if the component attribute equals to this or not expect this attribute if the component value equals to that? Is this beyond the scope of Typescript?