我设置Flow和React Native创建了默认的.flowcongif文件。但是“npm run flow”会返回大量关于本机库反应的错误:
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
答案 0 :(得分:0)
您使用的是正确的Flow版本吗?
检查.flowconfig
文件底部的版本,确保是您安装的版本。
现在就是:
npm --save-dev install flow-bin@0.42.0