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

Is there a way to preserve component's state when props change? #72

Open
ostronom opened this issue Dec 20, 2020 · 1 comment
Open

Is there a way to preserve component's state when props change? #72

ostronom opened this issue Dec 20, 2020 · 1 comment

Comments

@ostronom
Copy link

Suppose we are writing some kind of Login form and we have a component, that listens to on changed on a couple of Entry's which emit events with text upon which the component decides to enable/disable Login button. All user inputs from those entires are captured in Model as user types (to calculate validations and to emit the complete "form" via callback).

The next thing is that we want also to disable the login button right after user clicks it to prevent mulitclicking. To do so we provide an busy prop that is set on component in the outer UI declaration.

Right now if we change this busy param from outside the component -- the component will lose it's state (e.g. all of user inputs will still be in their respective UI widgets, but the model will be Default-ed) which leads to inconsistent disable/enable behavior.

Here is an example of this behavior.

@pepijndevos
Copy link
Collaborator

I'm not sure I understand what you mean by the model being defautled by setting the busy param from the outside

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

2 participants