batazor / react-final-form-generator

Generating form over react-final-form
MIT License
3 stars 1 forks source link
generator-form material-ui react-form ui

react-final-form-generator

Generating form over react-final-form

Feature

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>
  )
}

TODO