-
-
Notifications
You must be signed in to change notification settings - Fork 494
Description
Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
Flow type definitions aren't working
What is the expected behavior?
Flow type definitions should work
What's your environment?
Node: v9.5.0
Flow: v0.64.0
React: v16.2.0
Final-Form: v4.2.0
React-Final-Form: v3.1.0
Steps to reproduce
npm install flow-bin final-form react-final-form- Write this code:
/**
* @flow
*/
import { version } from 'react-final-form'
const v: number = version // This should throw error, but doesn't
console.log(v)- Run
flowin terminal or editor
As you can see, it doesn't cause any issues:
Possible solution
I think this may have to do with the fact that in the dist, the main file is react-final-form.cjs.js. I think this may mean that the .flow file that gets generated may need to be called react-final-form.cjs.js.flow. When I renamed index.js.flow to react-final-form.cjs.js, flow seems to work:
NOTE: The types still seem to be problematic however. When I use the simple example (only thing I changed was <Styles> to <div>), there seem to be all sorts of Flow errors. I'm not sure if this has to do with the type definitions being incorrect or not.

