You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importloadablefrom'@loadable/component'// option 1constList=loadable(()=>import(/* webpackChunkName: "List" */'./List'))-typeT is lost->becomesunknown// but! if it doesn't get lost like that// option 2constList=<T>()=>loadable<import('./List').ListProps<T>>(()=>import(/* webpackChunkName: "List" */'./List'))
SomeoneComponent.tsx
importListfrom'./index'typeTListItem={iconSize: number;title: string;label: string;}constdataSource: TListItem[]=Array.from({length: 10}).map((_,index)=>({iconSize: 10,title: `Item ${index}`,label: `Label ${index}`,}))// if i use the option 2constListTest=List<TListItem>()<ListTestdataSource={dataSource}rowKey="label"renderItem={(item: TListItem)=><ListItem{...item}/>}/>
I attached a screenshot of what vscode writes if I use option 1
The text was updated successfully, but these errors were encountered:
example:
List.tsx
index.ts
SomeoneComponent.tsx
I attached a screenshot of what vscode writes if I use option 1
The text was updated successfully, but these errors were encountered: