Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React Typescript: Cannot assign component to element

$
0
0

I need to map my JSX component(FC) inside an object for dynamic rendering.This is what I have come up with so far:

Interface for Object

interface Mappings {  EC2: {    component: React.FC<{}>;    name: string;    description: string;  };}export enum ResourcesEnum {  EC2 = 'EC2',  S3 = 'S3',}

The mapping object defined in the same file:

enter image description here

Error message:

Type 'Element' is not assignable to type 'FC<{}>'.Type 'Element' provides no match for the signature '(props: { children?: ReactNode; }, context?: any): ReactElement<any, any> | null'.

Thanks alot in advance!


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>