Using React with typescript I want to be able to create a dynamic component. Here is snapshot from code
const CustomTag = `${section.header_type}`;
<CustomTag className={styles.textimage__title}>{section?.header}</CustomTag>
on CustomTag markup in VSCode I get the following error
Type '{ children: string; className: string; }' is not assignable to type 'IntrinsicAttributes'.
Property 'children' does not exist on type 'IntrinsicAttributes'.ts
How do I define in this case for this component properly the types?
section.header_type?section.header_typeis an enum for headers like h1, h2, h2 and is definable in backend.