RectFormFields.js 855 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React from "react";
  2. import { Field } from "react-final-form";
  3. import Label from "./Label";
  4. const Form = ({ initialValues }) => {
  5. return (
  6. <>
  7. <Label>
  8. Label:
  9. <Field
  10. name="label"
  11. component="input"
  12. initialValue={initialValues.label}
  13. />
  14. </Label>
  15. <Label>
  16. Width:
  17. <Field
  18. name="width"
  19. component="input"
  20. initialValue={initialValues.width}
  21. >
  22. {(props) => <input {...props.input} type="number" />}
  23. </Field>
  24. </Label>
  25. <Label>
  26. Height:
  27. <Field
  28. name="height"
  29. component="input"
  30. initialValue={initialValues.height}
  31. >
  32. {(props) => <input {...props.input} type="number" />}
  33. </Field>
  34. </Label>
  35. </>
  36. );
  37. };
  38. export default Form;