Download tabler-react/src/forms/FormWithSingleInputAndButton.react.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 897 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/forms/FormWithSingleInputAndButton.react.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/forms/FormWithSingleInputAndButton.react.js
-
curl -L -o FormWithSingleInputAndButton.react.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/forms/FormWithSingleInputAndButton.react.js
897 Bytes
| // @flow | |
| import * as React from "react"; | |
| import Form from "../components/Form/Form.react"; | |
| import Button from "../components/Button/Button.react"; | |
| import type { Props as FormProps } from "../components/Form/Form.react"; | |
| import type { Props as FormInputProps } from "../components/Form/FormInput.react"; | |
| import type { Props as ButtonProps } from "../components/Button/Button.react"; | |
| type Props = {| | |
| formProps?: FormProps, | |
| inputProps?: FormInputProps, | |
| buttonProps?: ButtonProps, | |
| |}; | |
| /** | |
| * A form containing a single input field with an appended Button | |
| */ | |
| function FormWithSingleInputAndButton({ | |
| formProps, | |
| inputProps, | |
| buttonProps, | |
| }: Props): React.Node { | |
| const button = React.createElement(Button, buttonProps); | |
| return ( | |
| <Form {...formProps}> | |
| <Form.InputGroup inputProps={inputProps} append={button} /> | |
| </Form> | |
| ); | |
| } | |
| export default FormWithSingleInputAndButton; | |