Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-final-form-generator

batazor5MIT1.4.0

Generating form over react-final-form

react, form, generate

readme

react-final-form-generator

Generating form over react-final-form

Feature

  • generation form use JSON
  • condition

Usage

import Form, { Control } from 'react-final-form-generator'

// Fields
const fields = [
  {
    name: 'email',
    label: 'Email',
    type: 'TextField',
  },
  {
    name: 'submit',
    label: 'Submit',
    type: 'Button',
    condition: {
      when: 'email',
      is: 'test',
      action: '==',
    },
  },
]
// ...code

function renderForm() {
  return (
    <Form
      fields={fields}
      onSubmit={onSubmit}
    >
      <Control fields={fieldsOne} />
      <Control fields={fieldsTwo} />
    </Form>
  )
}