1.2.2 • Published 3 years ago

react-context-form-select v1.2.2

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years 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

3 years ago

1.2.1

3 years ago

2.0.0-3

6 years ago

2.0.0-2

6 years ago

2.0.0-1

6 years ago

2.0.0-0

6 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-rc5

7 years ago

1.0.0-rc4

7 years ago

1.0.0-rc2

7 years ago

1.0.0-rc1

7 years ago