react-final-form-generator

1.4.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i react-final-form-generator

Weekly Downloads

1

Version

1.4.0

License

MIT

Unpacked Size

3.29 MB

Total Files

10

Last publish

Collaborators

  • batazor