Closed ymor closed 3 years ago
Anybody knows what this is about @cssinjs/typescript ?
Hi @kof, Sorry I totally forgot about this issue and its has since been resolved. I can define something like the following which does what I expect.:
export const createUseMyThemeStyles =
<C extends string, Props = unknown>(styles: Styles<C, Props, MyTheme> | ((theme: MyTheme) => Styles<C, Props, undefined>)) =>
createUseStyles(styles, {theming: theming})
Expected behavior: I should be able to re-use the exported Styles type, when my typescript project has declarations set to true.
Describe the bug: On using the Styles export in a typescript project that has declarations set to true, I receive the following error: Exported variable 'createUseThemeStyles' has or is using name 'Func' from external module "/sandbox/node_modules/jss/src/index" but cannot be named.
Reproduction: https://codesandbox.io/s/sad-jackson-q3bnq I like to create a custom ThemeProvider so I can provide a default for tests. I also like to create a custom createUseStyles that injects this theme so it's all in one place. However on setting the type of the styles param to Styles I receive the error described above.
Versions (please complete the following information):