Skip to content

Instantly share code, notes, and snippets.

@DZuz14
Created July 17, 2021 17:06
Show Gist options
  • Save DZuz14/6b4068133c23557b626a90a62911a4ad to your computer and use it in GitHub Desktop.
Save DZuz14/6b4068133c23557b626a90a62911a4ad to your computer and use it in GitHub Desktop.
coh374
import { Form, FormGroup } from "react-bootstrap";
import formData from "./formData";
import useForm from "./useForm";
const SomeComponent = () => {
const { fields } = useForm(formData);
return (
<div css={CSS}>
<Form>
{fields.map((field) => (
<FormGroup key={field.name}>
<Form.Label>{field.name}</Form.Label>
<Form.Control
type={field.type}
name={field.name}
value={field.value}
onChange={() => {}}
placeholder={field.placeholder}
/>
</FormGroup>
))}
</Form>
</div>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment