Search code examples
reactjsreact-nativeredux-form

Redux-form and form tag : capital letter?


I want to install redux form. I read exactly the documentation, but I still have an error.

Invariant Violation : View config not found for name form. Make sure to strat component names with a capital letter.

My code is exactly the code of the documentation, Step 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

Solution

  • You are using the form tag and react-native can't render it so use View tag instead. you will have to create the button and use onClick={handleSubmit} on that button.