私はこのエラーを一日中解決しようとしています。 ReactアプリにFlowを追加しようとしています。リアクション+フロー+エスプリント
私はこのように宣言コンポーネントがあります。MyComponentProps今
type MyComponentProps = {
prop1: string,
prop2: string
};
ため
// @flow
class MyComponent extends Component {
static defaultProps = {
prop1: 'a',
prop2: 'b'
};
handleOnClick: (value: string) => void;
props: MyComponentProps;
}
と種類を、フローはエラーを報告しません。私はbabel-eslint
とeslint-plugin-flowtypeを使用してい
error 'defaultProps' is not defined no-undef
error 'handleOnClick' is not defined no-undef
error 'props' is not defined no-undef
:私はアプリを実行しようとする。しかし、私はeslint
エラーが発生します。 .eslintrc
ファイルにflowtype/define-flow-type
ルールを追加しました。 .eslintrc
ファイルの関連部分は次のとおりです。
{
"parser": "babel-eslint",
"plugins": [
"flowtype",
"react"
],
"extends": [
"plugin:flowtype/recommended"
],
"rules": {
"flowtype/define-flow-type": 1,
"flowtype/use-flow-type" : 1,
"no-undef": 2,
"react/jsx-no-undef": 2
}}
私は何が欠けていますか?
宣言やそれらを参照しているどこかでESLintエラーが発生していますか? – btmills
宣言について – Maggie
eslint、babel-eslint、およびeslint-plugin-flowtypeのどのバージョンがありますか? – btmills