@prestojs/final-form
TypeScript icon, indicating that this package has built-in type declarations

0.0.36 • Public • Published

React Final Form Integration

Integration with react-final-form that fills out the widget to use based on a ViewModel field.

TODO: Review/expand this once interface settled

Basic usage

import React from 'react';
import { Form } from '@prestojs/final-form';

function UserForm(onSubmit) {
    return (
        <Form onSubmit={onSubmit}>
            <Form.Item field={User.fields.firstName} />
            <Form.Item field={User.fields.lastName} />
            <Form.Item field={User.fields.email} />
            <Form.Item field={User.fields.email} name="emailConfirmation" label="Confirm Email" />
            <Form.Item>
                <Form.Field name="signUpNewsletter">
                    {({ input }) => <Checkbox {...input}>Sign up to newsletter?</Checkbox>}
                </Form.Field>
            </Form.Item>
            <button type="submit">Submit</button>
        </Form>
    );
}

Readme

Keywords

none

Package Sidebar

Install

npm i @prestojs/final-form

Weekly Downloads

27

Version

0.0.36

License

MIT

Unpacked Size

81.5 kB

Total Files

26

Last publish

Collaborators

  • davealliance
  • levic