Open fragsalat opened 2 years ago
Can't we just fix this instead of living with workarounds? I even provided a PR. typeof might work in this case but when extending a component for some reason it can get tricky to create the types. Also it would mean every people has to use typeof on every component which get's styled which uses internal interfaces.
So If I use :typeof TS4082: Default export of the module has or is using private name 'TableInterface'
The only proper solution is to export the used interfaces as well.
This works for me on 4.23
export const WrapperContent = styled(Layout as FC<LayoutProps>)<{
$noPadding: boolean;
}>`
padding-top: ${({ $noPadding, theme }) => $noPadding === true ? 0 : 20}px;
`;
Reproduction link
Steps to reproduce
This error happens for a lot of components which for some reason use private interfaces
What is expected?
All interfaces used for exports are exported and typescript can grab them
What is actually happening?
Typescript can not build type definition from hidden interfaces
Please check all components for those non exported interfaces. There are more. Table for instance. Referring to this older ticket https://github.com/ant-design/ant-design/issues/24864