react-context-form-select
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

React Context Form Select

react-select integration with react-context-form

Usage

import * as React from "react";
import { Form, FormGroup, SubmitButton } from "react-context-form";
import { Select } from "react-context-form-select";
import { Options } from "react-select";
import { instantiateTestModel } from "./test";

export enum Role = {
    admin: "Admin",
    user: "User",
}  

class RoleSelect extends Select<Role> {};

const options: Options<Role> = Object.values(Role).map((value: string) => return {label: value, value: value});

export const Form: React.SFC<{}> = () => (
    <Form instantiate={instantiateTestModel}>
        <FormGroup name="role">
            <RoleSelect options={options}>
        </FormGroup>
        <SubmitButton loadingComponent={<span>Loading...</span>}>Send</SubmitButton>
    </Form>
)

TODO

  • Tests

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.22latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.22
1.2.10
2.0.0-30
2.0.0-20
2.0.0-10
2.0.0-00
1.2.00
1.1.00
1.0.20
1.0.11
1.0.00
1.0.0-rc50
1.0.0-rc40
1.0.0-rc20
1.0.0-rc10

Package Sidebar

Install

npm i react-context-form-select

Weekly Downloads

3

Version

1.2.2

License

MIT

Unpacked Size

53.6 kB

Total Files

29

Last publish

Collaborators

  • horat1us