Top "Flowtype" questions

Flow is a static type checker, designed to find type errors in JavaScript programs, created by Facebook.

React eslint error missing in props validation

I have the next code, eslint throw: react/prop-types onClickOut; is missing in props validation react/prop-types children; is missing …

javascript reactjs eslint flowtype
React PropTypes vs. Flow

PropTypes and Flow cover similar things but are using different approaches. PropTypes can give you warnings during runtime, which can …

reactjs flowtype react-proptypes
How to set a default value for a Flow type?

I have defined a custom Flow type export type MyType = { code: number, type: number = 1, } I want the type parameter to …

javascript flowtype
Flow: Throws error Cannot resolve module "react-redux" even tho it's installed

Even tho module is installed and it exists, Flow cannot resolve it and throws error. See below: 1) Inside bash I …

javascript react-redux flowtype
Using Promise as return type in Flow

I'm using Flow 0.30.0. I have a function that returns a promise: function process(callback:Function):Promise { return new Promise((r,…

javascript flowtype
What's the right way to write Jest tests verified with Flow?

I imagine people commonly use Flow and Jest (and React) together, but Flow doesn't seem to know about Jest (or …

jestjs flowtype
Proper Flow type for React render method?

I'm curious what the proper Flow annotation is for both render methods in React classes, and simple returns in stateless …

javascript reactjs flowtype
How do you export a Flow type definition that is imported from another file?

Given a type definition that is imported from another module, how do you re-export it? /** * @flow */ import type * as ExampleType …

javascript flowtype
Flow (React Native) is giving me errors for using 'this.state'

Flow is giving me the following error whenever I try to use this.state in my code: object literal: This …

reactjs react-native flowtype
How can Flow be forced to cast a value to another type?

Is it possible to forcibly cast a variable in Flow? type StringOrNumber = string | number const foo: StringOrNumber = 'hello' // I look …

casting flowtype