react-css-themr icon indicating copy to clipboard operation
react-css-themr copied to clipboard

Typescript compiler fails when using react css themr with error Default export of the module has or is using private name 'TReactCSSThemrTheme'

Open sahilgupta202 opened this issue 7 years ago • 3 comments

Typescript Version : 2.4.2 React CSS Themr: 2.1.2

Replication Steps

  1. Create a component that uses themr. themr('Identifier')(ComponentName);
  2. Run the Typescript compiler

It will throw the following error error TS4082: Default export of the module has or is using private name 'TReactCSSThemrTheme'. error TS4082: Default export of the module has or is using private name 'ThemedComponentClass'.

sahilgupta202 avatar Aug 15 '17 17:08 sahilgupta202

Quick fix: just import it ;)

belohlavek avatar Sep 02 '17 16:09 belohlavek

Yes @belohlavek we used that, but that is not a good solution because TS Lint will fail as we are not using them and those will be unsed imports. Also, importing is private member of a library is never good as it may change in future updates.

sahilgupta202 avatar Sep 08 '17 08:09 sahilgupta202

I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. https://github.com/microsoft/TypeScript/issues/35822

trusktr avatar Dec 21 '19 20:12 trusktr