I am trying to make a class that looks like this
export default class IconModel { name: string title: string iconType: "AntDesign" | "Ionicons" component: React.Component //What type should be used? iconName: string size: number}
What I want is to make the component
prop only be able to be passed a react component (ex: Home.tsx)
I am then using it like this
import { HomeScreen } from '../../../screens';var iconData: IconModel[] = [ { component: HomeScreen, iconName: "appstore1", iconType: "AntDesign", ...<NavigationContainer><BottomTab.Navigator initialRouteName={INITIAL_ROUTE_NAME}> {iconData.map((x, key) => (<BottomTab.Screen name={x.name} component={x.component} options={{ title: x.title, tabBarIcon: ({ focused }) => <TabBarIcon focused={focused} data={x} />, }} /> ))}</BottomTab.Navigator></NavigationContainer>
Are you able to type a variable or prop as a JSX/React component?