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

Error when using --strictNullChecks Typescript's compiler option #28

Open
thenameisflic opened this issue Mar 28, 2018 · 2 comments
Open

Comments

@thenameisflic
Copy link

I created a simple project via preact-cli, added the typescript plugin, redux and preact-redux, but i got this error when running npm run start:

✖ ERROR [at-loader] ./node_modules/preact-redux/src/preact-redux.d.ts:278:5
    TS2416: Property 'render' in type 'Provider' is not assignable to the same property in base type 'Component<ProviderProps, {}>'.
  Type '(props: ProviderProps) => VNode' is not assignable to type '(props?: (ProviderProps & ComponentProps<this>) | undefined, state?: {} | undefined, context?: an...'.
    Types of parameters 'props' and 'props' are incompatible.
      Type '(ProviderProps & ComponentProps<this>) | undefined' is not assignable to type 'ProviderProps'.
        Type 'undefined' is not assignable to type 'ProviderProps'.
@thenameisflic
Copy link
Author

As a workaround, i added my own preact-redux.d.ts and told typescript to ignore the module typings.

@bestmike007
Copy link

It's fixed on master branch:

https://github.com/developit/preact-redux/blob/master/src/preact-redux.d.ts#L278

But not published yet:

https://github.com/developit/preact-redux/blob/2.0.3/src/preact-redux.d.ts#L278

@developit need a new package version with this fix.

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