1.2.2 • Published 1 year ago

react-context-form-select v1.2.2

Weekly downloads
4
License
MIT
Repository
github
Last release
1 year ago

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

1.2.2

1 year ago

1.2.1

1 year ago

2.0.0-3

5 years ago

2.0.0-2

5 years ago

2.0.0-1

5 years ago

2.0.0-0

5 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

1.0.0-rc5

6 years ago

1.0.0-rc4

6 years ago

1.0.0-rc2

6 years ago

1.0.0-rc1

6 years ago