gpt4 book ai didi

javascript - 使用 Flow 获取 React Native 错误

转载 作者:行者123 更新时间:2023-11-28 04:38:58 25 4
gpt4 key购买 nike

我设置了 Flow,React Native 创建了它的默认 .flowcongif 文件。但是“npm run flow”返回大量有关 React Native 库的错误:

node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS.ios.js:38
38: const DatePickerIOS = React.createClass({
^ call of method `createClass`. Expected a React PropType instead of
371: hitSlop: EdgeInsetsPropType,
^^^^^^^^^^^^^^^^^^ object type. See: node_modules/react-native/Libraries/Components/View/View.js:371

node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS.ios.js:105
105: this.props.onChange && this.props.onChange(event);
^^^^^^^^^^^^^^^^^^^^^^^^^^ call of method `onChange`. Function cannot be called on
105: this.props.onChange && this.props.onChange(event);
^^^^^^^^^^^^^^^^^^^^^^^^^^ property `onChange` of unknown type

最佳答案

您使用的 Flow 版本是否正确?

检查 .flowconfig 文件底部的版本,并确保这是您安装的版本。

现在是:

npm --save-dev install flow-bin@0.42.0

关于javascript - 使用 Flow 获取 React Native 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43947444/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com