flow types imported from library are all 'any'
See original GitHub issueHello
I am trying to import flow types from your library for use in my application. Unfortunately, they appear to be all ‘any’. I have this simple example:
/* @flow */
import type { LocationState, NavigationAction } from 'redux-first-router';
const location: LocationState = {
foo: 'bar',
car: 1,
};
Running flow
I see No errors!
and no complaints from my editor (vscode). If I hover over the types, vscode tells me they are ‘any’.
I have had a dig around in node_modules/redux-first-router/dist and the flow-types.js
file is empty. There are type definitions in flow-types.js.flow
and index.js.flow
.
I am have tried v0.0.16-next and v1.9.19 with no success. I am on flow version 0.52.0.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Can't import module types in Flow library definitions #2023
So just to clarify – Flow itself does allow importing types from different libraries, but flow-typed doesn't currently support it. @villesau ...
Read more >Module Types | Flow
Importing and exporting types. It is often useful to share types in between modules (files). In Flow, you can export type aliases, interfaces,...
Read more >Importing in library definition (flow-typed/) doesn't work in flow ...
Importing in library defintion file (flow-typed/lib.js) doesn't seem to work correclty. Directory structure in flow-typed : flow-typed | - lib ...
Read more >Flow | Checking third-party code
Note that if a 3rd party library is present in your project that isn't itself typed, Flow will treat it just like any...
Read more >What I wish I had known before starting to use Flow
Unfortunately, the library definition syntaxes differ enough to make them ... In some projects, it might be possible to type all the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey mate, I think I have fixed this problem. The
// @flow
annotation was missing inindex.js
. I tested my changes with the repo above and the types are being imported correctly.Am I importing the types in the right way?
I have put together a simple repo that illustrates the problem. Could you please tell me what behaviour you get?
https://github.com/petegleeson/redux-first-router-flow