Skip to content

Loading previous state on re-render #556

Answered by mrchief
borisboguslavsky asked this question in Q&A
Discussion options

You must be logged in to vote

Any reason why you just don't hide and toggle? Re-render is inefficient if you're showing the same thing.

However, if you still want to do it, you'd have to keep track of state on your end as well. You can search old issues for similar asks but basically you'd be listening to onChange and updating the data in one of your state bags. So everytime, something is checked, you'd go into your data bag and update selected: true for corresponding node. When you re-render, you'd assign this updated data to the component and it should restore state for you.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@borisboguslavsky
Comment options

@mrchief
Comment options

Answer selected by borisboguslavsky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants