【问题标题】:Redux-form and form tag : capital letter?Redux-form 和 form 标签:大写字母?
【发布时间】:2019-12-11 20:27:55
【问题描述】:

我想安装 redux 表单。我完全阅读了文档,但仍然有错误。

不变违规:未找到名称形式的视图配置。确保使用大写字母对组件名称进行分层。

我的代码正是文档的代码,第 2 步:https://redux-form.com/7.2.2/docs/gettingstarted.md/

import React from 'react'
import { Field, reduxForm } from 'redux-form'

let ContactForm = props => {
  const { handleSubmit } = props
  return <form onSubmit={handleSubmit}>{/* form body*/}</form>
}

ContactForm = reduxForm({
  // a unique name for the form
  form: 'contact'
})(ContactForm)

export default ContactForm

【问题讨论】:

    标签: reactjs react-native redux-form


    【解决方案1】:

    您正在使用表单标签并且 react-native 无法呈现它,因此请改用 View 标签。您必须创建按钮并在该按钮上使用 onClick={handleSubmit}。

    【讨论】:

      猜你喜欢
      • 2017-08-26
      • 2018-01-14
      • 2017-04-04
      • 2015-07-28
      • 2016-12-24
      • 1970-01-01
      • 2016-12-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多