I have created a Template component in React and TypeScript where you could use each section within the Template to render different contents in. For example;
<Template>
<Template.Main>
This is the main sub-section within Default template.
</Template.Main>
<Template.Footer>
This is the footer sub-section.
</Template.Footer>
</Template>
Everything works and renders fine without any error on the console, however there is this TypeScript error "Property Footer does not exist on type FC", but I'm not sure what I'm doing wrong.
Somehow TypeScript does not like how I have chained different sections to the Template component, so I would appreciate if anybody could help me with this.
This is the TEMPLATES.REGIONS constant.
This is the < Template /> component itself.
This is how is rendered out.
This is how the < Template /> component is used in the main index file.
I have put a demo together in CodeSandbox, but for some reason it doesn't outputs any error over there and it only happens locally!
Demo: https://codesandbox.io/s/react-template-n1qyv
Thank in advance.