I am using Astro, GraphQL (Apollo Client), Typescript and React.
In my dynamic route: [...slug].astro
file I need to conditionally render a certain Astro component.
I managed to that with:
{data.page.type === 'PageOneType' && <PageOne />}
{data.page.type === 'PageTwoType' && <PageTwo />}
Can I somehow make this more dynamic, so I don’t have to add it static like above in case there are more page types in the feature?
Or do I need to pull in React for this?