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

shouldComponentUpdate() is too conservative #45

Open
FranciscoPinto opened this issue Feb 12, 2019 · 0 comments
Open

shouldComponentUpdate() is too conservative #45

FranciscoPinto opened this issue Feb 12, 2019 · 0 comments

Comments

@FranciscoPinto
Copy link

FranciscoPinto commented Feb 12, 2019

Hello,

First of all, thank you very much for the nice package, which has already saved us a considerable amount of time.

Currently, shouldComponentUpdate() seems to return true only when the navs change. This messes with my workflow in multiple ways:

  • I want to disable the form as it is being submitted;
  • My form has children (a custom button which animates while the form is being submitted, a "Saved!" message when the data the form is currently displaying is stored server-side, etc.).

To experiment, I overrode shouldComponentUpdate() and made it always return true. However, this made my form's fields lose focus on change arbitrarily. This leads me to believe the author is using shouldComponentUpdate() to prevent this buggy behaviour as opposed to solely as a performance optimization.

Here's an SSCCE: https://codesandbox.io/s/q8o8mmlyoj

Thanks for any help you may be able to provide. I might start work on a PR in parallel.

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

No branches or pull requests

1 participant