How to use reactive flow types

I just started using a thread in a reciprocal project. there seems to be a lot of nice input stream already built-in for the most part responding to native apis. but how can I get my typechecker stream to use them in my project?

Here is an example that does not work:

// @flow import { StatusBar } from 'react-native'; const fn = () => { StatusBar.setBarStyle('this-is-not-in-enum'); }; 

A call to StatusBar.setBarStyle should generate a stream error based on the types of streams in the original reaction source code. You can see this code at https://github.com/facebook/react-native/blob/0.42-stable/Libraries/Components/StatusBar/StatusBar.js#L201

My.flowconfig:

 [ignore] ; We fork some components by platform .*/*[.]android.js ; Ignore templates for 'react-native init' .*/local-cli/templates/.* ; Ignore the website subdir <PROJECT_ROOT>/website/.* ; Ignore "BUCK" generated dirs <PROJECT_ROOT>/\.buckd/ ; Ignore unexpected extra "@providesModule" .*/node_modules/.*/node_modules/fbjs/.* ; Ignore duplicate module providers ; For RN Apps installed via npm, "Libraries" folder is inside ; "node_modules/react-native" but in the source repo it is in the root .*/Libraries/react-native/React.js .*/Libraries/react-native/ReactNative.js [include] [libs] Libraries/react-native/react-native-interface.js flow/ [options] emoji=true module.system=haste experimental.strict_type_args=true munge_underscores=true module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FixMe suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-8]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[az,_]*react_native_oss[az,_]*\\)?)\\) suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-8]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[az,_]*react_native_oss[az,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy unsafe.enable_getters_and_setters=true [version] ^0.38.0 
+5
source share

Source: https://habr.com/ru/post/1266142/


All Articles