Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript React intl、Redux表单合并并发出警告_Javascript_Reactjs_Redux - Fatal编程技术网

Javascript React intl、Redux表单合并并发出警告

Javascript React intl、Redux表单合并并发出警告,javascript,reactjs,redux,Javascript,Reactjs,Redux,我现在尝试使用React和Redux。我现在正在制作i18n应用程序,所以我必须在这个项目中使用React intl包。 现在我的登录表单是这样的。导入如下所示 import React, { Component } from 'react'; import { reduxForm } from 'redux-form'; import { injectIntl } from 'react-intl'; 现在,我想使用intl.formatMessage,所以我必须在这个组件中使用

我现在尝试使用React和Redux。我现在正在制作i18n应用程序,所以我必须在这个项目中使用React intl包。
现在我的登录表单是这样的。导入如下所示

import React, {
  Component
} from 'react';
import {
  reduxForm
} from 'redux-form';
import {
  injectIntl
} from 'react-intl';
现在,我想使用
intl.formatMessage
,所以我必须在这个组件中使用
injectIntl
,如下所示

export default injectIntl(LoginForm);
现在我没有收到任何错误。
另外,我想在我的登录名表单和电子邮件表单中使用Redux表单。像

export default reduxForm({
  form: 'loginForm',
  fields: ['name', 'password']
})(LoginForm);
我需要两者,所以我将它们合并为一个导出,如

export default reduxForm({
  form: 'entrance',
  fields: ['name', 'password']
})(injectIntl(LoginForm));

但以上两种类型我都有一个警告

warning.js:44Warning: Unknown props `initialValue`, `autofill`, `onUpdate`, `valid`, `invalid`, `dirty`, `pristine`, `active`, `touched`, `visited`, `autofilled` on <input> tag. Remove these props from the element. For details, see "abbred"
in input (created by TextField)
in div (created by TextField)
in TextField (created by Entrance)
in div (created by CardText)
...
warning.js:44警告:标签上的未知道具'initialValue','autofill','onUpdate','valid','invalid','dirty','pristine','active','toucted','visted','autofilled'。从元件上取下这些支柱。有关详细信息,请参阅“缩写”
输入中(由TextField创建)
在div中(由TextField创建)
在文本字段中(由入口创建)
在div中(由CardText创建)
...
我可以将这两种方法都用于此警告,但我希望如何消除此警告。

我该怎么做?

您需要将Redux表单更新到v6以克服这些错误(假设您正在运行React v15.2.0+)。运行:

由于Redux表单的基础结构发生了重大变化,您还需要更改使用Redux表单的方式。请查看此处的文档:

此外,本教程还提供了代码示例,演示了Redux Form v6设置的外观:

warning.js:44Warning: Unknown props `initialValue`, `autofill`, `onUpdate`, `valid`, `invalid`, `dirty`, `pristine`, `active`, `touched`, `visited`, `autofilled` on <input> tag. Remove these props from the element. For details, see "abbred"
in input (created by TextField)
in div (created by TextField)
in TextField (created by Entrance)
in div (created by CardText)
...
npm install --save redux-form@6.0.0-rc.3