Skip to content

Zustand re-rendering issue after restoring the state from indexedDB #2966

Answered by anni1236012
anni1236012 asked this question in Q&A
Discussion options

You must be logged in to vote

I figured out the issue. The problem occurs because when the state is rehydrated from IndexedDB, new object references are created for the AST nodes, breaking the reference equality between selectedNode.node and the nodes in the component tree. instead of using the huge object as it is, I had to recreate the object by using the raw component string.

In short, issue was due to object references were not the same after restored the state from the database.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@anni1236012
Comment options

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