Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3452 | Rev 3628 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3452 Rev 3555
Línea 4... Línea 4...
4
import { Spinner } from '..';
4
import { Spinner } from '..';
Línea 5... Línea 5...
5
 
5
 
6
export function Form({
6
export function Form({
7
  children,
7
  children,
-
 
8
  onSubmit,
8
  onSubmit,
9
  defaultValues,
9
  defaultValuesPromise,
10
  defaultValuesPromise,
10
  reset: propReset = false,
11
  reset: propReset = false,
11
  ...rest
12
  ...rest
12
}) {
13
}) {
13
  const methods = useForm();
14
  const methods = useForm({ defaultValues });
14
  const { handleSubmit, reset } = methods;
15
  const { handleSubmit, reset } = methods;
Línea 15... Línea 16...
15
  const [loadingDefaults, setLoadingDefaults] = useState(true);
16
  const [loadingDefaults, setLoadingDefaults] = useState(true);
16
 
17
 
Línea 42... Línea 43...
42
  const handleFormSubmit = (data) => {
43
  const handleFormSubmit = (data) => {
43
    if (onSubmit) {
44
    if (onSubmit) {
44
      onSubmit(data);
45
      onSubmit(data);
45
    }
46
    }
46
    if (propReset) {
47
    if (propReset) {
47
      reset();
48
      reset(undefined, { keepDefaultValues: true });
48
    }
49
    }
49
  };
50
  };
Línea 50... Línea 51...
50
 
51
 
51
  return (
52
  return (