Why is React Native.flowconfig ignoring .android.js files?

I wanted to test the flow in my React Native project. I ran the stream and found that this did not affect the Android files. I found the code below in .flowconfig:

[ignore] # We fork some components by platform. .*/*.web.js .*/*.android.js 

Why did the React Native team ignore these files? I could not find much information about the same where. I know that I can edit, and the stream will also start looking at Android files, but I'm not sure if this will be correct. For example, this is what fabergua commented on the problem. Flow does not recognize platform-specific files related to the reaction related to it:

@mhollweck: React. The original default.flowconfig is configured to ignore. all .android.js files. You can get around this by changing -./[.†android.js./ node_modules /./* [.] Android.js in your project's .flowconfig.

But, if we continue with such a workaround? Would it not bother with the project when we upgrade it with response-native-git-upgrade ?

+5
source share
2 answers

I always thought that they ignore Android by default, because often you prefer Flow to work sequentially with certain modules of the platform, and iOS was the original platform for React Native. Let's say you are trying to "go to the definition" for a specific function defined both in myFunction.ios.js and myFunction.android.js . If you ignore *.android.js , the stream will go sequentially to the *.ios.js files. Therefore, if your application is mainly focused on Android, I would switch it to *.ios.js .

+2
source

*.android.js files are ignored by default in order to choose a platform arbitrarily, but it is also necessary to start the stream as follows:

 [ignore] ; We fork some components by platform .*/*[.]ios.js ... [options] module.file_ext=.native.js module.file_ext=.android.js module.file_ext=.js 
0
source

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


All Articles