It seems there's a subtle difference between type decleration for named function() syntax vs anonynous function syntax:  type F<X, Y> = (x: X) => Y  // works: function apply<X, Y>(f: F<X, Y>, x: X) : Y {     return f(x) }  //...
I have a value that comes from a select input and is of type string, however I want to pass it into a function (updateLanguage) that receives as argument a string enum with a type alias (Language).   The problem I'm facing is that Flow only allow...
TL;DR How do I tell flow to import type definitions from imported modules not declared with @flow?  Longer version  Flow seams to be able to derive types from files not using the flow syntax (see example).   Example file 'flow.js'  if(Math.ra...
Let's say I have this function (try online):  type Person = { name: string } function getName(p: ?Person): ?string {   if (!p) {     return p   } else {     return p.name   } }  const frank: Person = { name: 'Frank' } /*  * In order to wo...
So confused on using '?' in flow. AFAIK (thanks to flow type question mark before or after param?):   When '?' before ':', means bar is optional, can be string or undefined:  bar?: string  When '?' after ':', m...
I'm trying to type the redux store like this : const s:Store<S,A>=createStore (todoApp) but I get   identifier Store ... Could not resolve name flow error  any idea how to fix this ?   I am using this flow typed declarations:  // flow-typed...
I get this error when running flow check, but I'm not sure what it means.     Cannot use exports as a type because exports is a value. To get the type of a value use typeof.   The error location is 0:1 (at the @flow comment). Here's the code:...
I have a value of type Array<A> (an array of subtypes). Flow doesn’t let me pass it to a place that expects Array<A | B> (an array of supertypes), even though it obviously works.  For example, I can’t assign a value with type Array<...
Here's a boiled down example that fail with the error  assignment of computed property/element. Indexable signature not found  Surely flow can read the types and strings in the methods array. Why is it complaining?...
I am using ESLint in a project and want to use Facebook flow as well, But I am getting warnings from ESLint on flow type annotations.  I have .flowconfig and .eslintrc in project root.  .eslintrc:  // When you write javascript you should follow these...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.