question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CompoundedComponent and DropdownInterface is not exported which results in error ts(4032)

See original GitHub issue

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Wrap Button component into styled (styled-components)

What is expected?

No error

What is actually happening?

We are exporting component that using an interface that hadn’t exported and in result we have error Exported variable 'ButtonStyled' has or is using name 'CompoundedComponent' from external module "/sandbox/node_modules/antd/es/button/button" but cannot be named.ts(4023)

Environment Info
antd 5.0.0
React react
System Windows 10
Browser Chrome

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ctretyakcommented, Nov 22, 2022

remove "declaration": true from tsconfig.json and it will disappear the error

Of course, but if I need it?

0reactions
callmenikkcommented, Nov 22, 2022

thats good issue, if CompoundedComponent and DropdownInterface had exports that would fix that error easily doing like this

import { CompoundedComponent } from 'antd/lib/button/button';

export const SButton: CompoundedComponent = styled(Button)``
Read more comments on GitHub >

github_iconTop Results From Across the Web

Rollup says "[name] is not exported by [file]" while it clearly is
In a svelte component you will need to import your types by specifying that what you import is a type: import { Topic...
Read more >
TypeScript errors and how to fix them
When you are importing a module with built-in TypeScript declarations and TypeScript tells you that this module does not have a default export, ......
Read more >
afc163 - PullAnswer
tsc --noEmit error: Type '"onResize"' is not assignable to type 'keyof ... and DropdownInterface is not exported which results in error ts(4032).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found