【发布时间】:2017-08-07 07:59:27
【问题描述】:
您好,我想用 React Native 打个招呼。 我创建了项目 'react-native init' 更改了 '.flowconfig' 中的流程版本。
运行流程,它给了我 153 个错误,这些错误位于 node_modules 文件夹中,例如
node_modules/react-native/Libraries
有人遇到同样的问题吗?
【问题讨论】:
标签: react-native flowtype
您好,我想用 React Native 打个招呼。 我创建了项目 'react-native init' 更改了 '.flowconfig' 中的流程版本。
运行流程,它给了我 153 个错误,这些错误位于 node_modules 文件夹中,例如
node_modules/react-native/Libraries
有人遇到同样的问题吗?
【问题讨论】:
标签: react-native flowtype
发现这个issue 建议更新flowconfig 以使用latest version from create-react-native-app。似乎对我有用。
【讨论】:
我遇到了同样的问题。你需要做两步:
[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
declare module 'react-native' { declare var exports: any; }
declare module 'jest' { declare var exports: any; }
另外,声明所有模块流抛出错误(例如'mobx' - 我知道这可能有点令人沮丧,但必须这样做)
【讨论】:
This modules resolves to "<<PROJECT_ROOT>>/../../node_modules/react/package.json", which is outside both your root directory and all of the entries in the [include] section of your .flowconfig. You should either add this directory to the [include] section of your .flowconfig, move your .flowconfig file higher in the project directory tree, or move this package under your Flow root directory.: /Users/*********/ReactNative/ToDoList/index.ios.js:18 我真的不知道要为此添加哪个模块。
<Text nonExistantProp="purple-panda"></Text> 和 flow 会很有趣。