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

Make <State/> reset on initial change #33

Closed
IniZio opened this issue Oct 11, 2018 · 0 comments · Fixed by #44
Closed

Make <State/> reset on initial change #33

IniZio opened this issue Oct 11, 2018 · 0 comments · Fixed by #44
Labels
enhancement New feature or request

Comments

@IniZio
Copy link
Owner

IniZio commented Oct 11, 2018

Is your feature request related to a problem? Please describe.
For example we have a form that creates / edit an item. If it is null we treat as create. But it takes time for the item to load so:

<State initial={item}></State>

will have problem because even if item is changed from null to the actual info, the store in State will not change accordingly, so we have to not mount it til loaded like this:

{(id === 'create' || item) && <State initial={item}></State>}

Describe the solution you'd like
Add a prop that makes State reset the store again on prop change?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@IniZio IniZio added the enhancement New feature or request label Oct 11, 2018
@IniZio IniZio changed the title Make <State/> able to set store on external prop change Make <State/> reset on initial change Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant