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

[BUG] formValues does not update on props change #3793

Closed
manubb opened this issue Jan 29, 2018 · 4 comments
Closed

[BUG] formValues does not update on props change #3793

manubb opened this issue Jan 29, 2018 · 4 comments
Labels

Comments

@manubb
Copy link
Contributor

manubb commented Jan 29, 2018

What is the current behavior?

When a component is decorated with formValues using a function argument, connected values are not updated when props of the component change.
For example:

formValues({ person } => ({
  name: `${person}.name`,
}))(Component)

When person changes, the component is still connected with the name of the person it has when mounted.

What is the expected behavior?

I am expecting formValues to react to props change.

Other information

The cause of the problem is straightforward when reading the sources:

  • valuesMap is only computed in constructor and is not computed again when props change.
  • this.Component is not updated either and the render method uses the initially computed this.Component.

I can PR a patch if you feel this is worth to fix.

@gustavohenke
Copy link
Collaborator

Great, it seems like you already have the fix! Can you send the fix in a PR?

@manubb
Copy link
Contributor Author

manubb commented Jan 29, 2018

The fix still needs a little work. I will PR this evening or next. Thanks for fast reply.

@erikras
Copy link
Member

erikras commented Feb 1, 2018

Published fix in v7.2.2.

@lock
Copy link

lock bot commented Feb 1, 2019

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 Feb 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants