Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submitting state #30

Closed
thangngoc89 opened this issue Feb 21, 2018 · 4 comments
Closed

Submitting state #30

thangngoc89 opened this issue Feb 21, 2018 · 4 comments
Assignees
Labels

Comments

@thangngoc89
Copy link
Contributor

onSubmit callback has a method named setSubmitting but the children function doesn't expose that state. I can send a PR to expose this. What do you think?

@fakenickels
Copy link
Member

The state is exposed in form.isSubmitting

@fakenickels
Copy link
Member

  type state = {
    values,
    isSubmitting: bool,
    errors: list((Config.fields, option(string))),
    error: option(string)
  };
  /* Type of what is given to the children */
  type reform = {
    form: state,
    handleChange: (Config.fields, value) => unit,
    handleGlobalValidation: option(string) => unit,
    handleSubmit: unit => unit,
    getErrorForField: Config.fields => option(string)
  };

currently, this is are the exposed utils
the state is the form field of the record passed

@fakenickels fakenickels self-assigned this Feb 21, 2018
@thangngoc89
Copy link
Contributor Author

Thank you. I need to take (another) closer look at the source. 👍

@fakenickels
Copy link
Member

it is also pointed out here! https://github.com/Astrocoders/reform#form-paramsstate
maybe we should update the demos to make this clearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants