Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThemeProvider is not working with TypeScript #64

Closed
janhartmann opened this issue Nov 1, 2018 · 2 comments
Closed

ThemeProvider is not working with TypeScript #64

janhartmann opened this issue Nov 1, 2018 · 2 comments

Comments

@janhartmann
Copy link

janhartmann commented Nov 1, 2018

Using the ThemeProvider like so:

import { ThemeProvider } from "theming";

<ThemeProvider theme={myTheme}>
    <App />
</ThemeProvider>

Gives the following compile error:

[ts] JSX element class does not support attributes because it does not have a 'props' property. [2607]
[ts] Property 'theme' does not exist on type '{}'. [2339]

Also making the options optional on the withTheme would be great.

export default withTheme(injectSheet(styles)(App), {
  forwardInnerRef: true // <--- this
});

Broke in the newest version 2.1.0.

@HenriBeck HenriBeck mentioned this issue Nov 1, 2018
@HenriBeck
Copy link
Member

HenriBeck commented Nov 1, 2018

Thanks for the report. I was using the wrong factory type for the default ThemeProvider.

Could you please approve the PR so I could release a fix?

@HenriBeck
Copy link
Member

Okay, release as 2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants