反应本机和流错误消息

时间:2017-03-16 08:45:29

标签: react-native flowtype

您好我正试图用React Native做一些问候世界。 我创建项目'react-native init'更改'.flowconfig'中的流版本。

跑流,它给了我153个错误,这些错误位于 select cust_id from (select cust_id , MIN(sum_value) as m from ( select cust_id,req ,sum(req_met) as sum_value from <data_frame> group by cust_id,req ) temp group by cust_id )temp1 where m>0 ; 文件夹中 node_modules

有没有人遇到同样的问题?

2 个答案:

答案 0 :(得分:15)

我遇到了同样的问题。您需要执行两个步骤:

1。将 .flowconfig 与此文件进行比较,并添加您缺少的行:

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

; 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

<PROJECT_ROOT>/node_modules/.*
<PROJECT_ROOT>/libdefs.js
.*/__tests__/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
./libdefs.js

2。将 libdefs.js 创建到根文件夹中。它看起来应该是这样的:

declare module 'react-native' { declare var exports: any; }
declare module 'jest' { declare var exports: any; }

另外,声明所有模块流程都会引发错误(例如'mobx' - 我知道这可能有点令人沮丧,但必须要这样做)

答案 1 :(得分:0)

找到此issue,建议更新flowconfig以使用latest version from create-react-native-app。似乎对我有用。