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

[v6 rc5] form-specific change action is not bound anymore #1579

Closed
mihhailk opened this issue Aug 22, 2016 · 5 comments
Closed

[v6 rc5] form-specific change action is not bound anymore #1579

mihhailk opened this issue Aug 22, 2016 · 5 comments

Comments

@mihhailk
Copy link

I have quite common use-case: some fields are updating on another field change. As I have understood, in order to achieve that we should use change action creator that is injected as prop to form component.
I got it working in rc4 version, but after updating to rc5 it seems that change is not a prop anymore.
[v6 rc4] working code:

Form.propTypes = {
  change: PropTypes.func.isRequired,
  dispatch: PropTypes.func.isRequired
}

then in Form component:

updateField(field, value) {
  const {dispatch, change} = this.props;
  dispatch(change(field, value));
}

The same code in rc5 results in an warning:
Failed prop type: Required propchangewas not specified in Form

Sidenote: docs say that change should already be bound to dispatch (if I understand "actions [...] are already bound to dispatch" correctly), but it seems that in rc4 one should still dispatch it manually. Please correct me if I am wrong

@erikras
Copy link
Member

erikras commented Aug 22, 2016

This did change as part of the introduction of the Fields component. I will investigate. 🔍

@andrepcg
Copy link

andrepcg commented Aug 22, 2016

I was too manually changing the value of some fields and it was very useful in specific situations, so this breaks my code

@erikras
Copy link
Member

erikras commented Aug 23, 2016

Fixed in #1588. Will post again here when it has been released. Thanks.

@erikras erikras closed this as completed Aug 23, 2016
@erikras
Copy link
Member

erikras commented Aug 25, 2016

Published in v6.0.1.

@lock
Copy link

lock bot commented Jun 2, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants