Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

How to preserve ui state after remount. #59

Closed
ryerh opened this issue Oct 14, 2016 · 2 comments
Closed

How to preserve ui state after remount. #59

ryerh opened this issue Oct 14, 2016 · 2 comments

Comments

@ryerh
Copy link
Contributor

ryerh commented Oct 14, 2016

Is there any options to let me preserve components' ui state? In some senerio, that component may remount to component tree.

Any thing like this ?

@ui({
  preserveOnUnmount: true,
  state: {
    foo: 'foo',
    bar: 'bar',
  }
})
class BazComponent extends React.Comopnent {}
@zxqx
Copy link

zxqx commented Oct 14, 2016

@ryerh Have you tried persist: true?

optional persist, defaults to false. if set to true persist will keep UI state for this component after it unmounts. if set to false the UI state will be deleted and recreated when the component remounts.

@ryerh
Copy link
Contributor Author

ryerh commented Oct 21, 2016

@zakangelle I haven't notice that, thanks 👍

@ryerh ryerh closed this as completed Oct 21, 2016
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

2 participants