Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Flow errors about State type in combination with Redux and flow-typed #898

Closed
strayer opened this issue Jul 26, 2017 · 3 comments · Fixed by #975
Closed

Flow errors about State type in combination with Redux and flow-typed #898

strayer opened this issue Jul 26, 2017 · 3 comments · Fixed by #975

Comments

@strayer
Copy link

strayer commented Jul 26, 2017

Intended outcome:
react-apollo should work with react-redux, redux and flow-typed out of the box.

Actual outcome:
Running the flow type validation shows type errors in react-apollo related to redux Store type.

node_modules/react-apollo/index.js.flow:30
 30:     store: Store,
                ^^^^^ Store. Application of polymorphic type needs <list of 2 arguments>. (Can use `*` for inferrable ones)

How to reproduce the issue:
Reproduced in this repo: https://github.com/Strayer/ApolloFlowIssues
Install dependencies, then run yarn run flow to see the errors.

Version

  • apollo-client@1.9.1
  • react-apollo@1.4.12
  • react-redux@5.0.6
  • redux@3.7.2

Edit 2017-08-11: Removed now invalid part about import errors, updated versions.

@stevemolitor
Copy link

stevemolitor commented Jul 26, 2017

I am seeing the first error also, and similar errors. If I change for example store: Store to store: Story<any> in the react-apollo flow declarations, the errors go away.

@barbu110
Copy link

barbu110 commented Aug 1, 2017

Anything on this yet?

@strayer
Copy link
Author

strayer commented Aug 11, 2017

The import errors seem to be resolved in react-apollo@1.4.12, the errors about store are still occurring though. Updated the example project to the newest versions.

richardgirges added a commit to richardgirges/react-apollo that referenced this issue Aug 12, 2017
…Store. Application of polymorphic type needs <list of 2 arguments>.`. This fix is basically adding inferred types (`*`) as arguments to all references to the Redux `Store` flow type inside of `index.js.flow`. This should fix apollographql#898.
jbaxleyiii pushed a commit that referenced this issue Aug 13, 2017
…Store. Application of polymorphic type needs <list of 2 arguments>.`. This fix is basically adding inferred types (`*`) as arguments to all references to the Redux `Store` flow type inside of `index.js.flow`. This should fix #898. (#975)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants