Maintain the state of Sandpack providers and layouts #823
Unanswered
pratikgcet
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Sorry, I couldn't reproduce what you descrived. Could you please create a sandbox using this template where I can reproduce it? Thanks |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Please see my code below. Whenever I click the button the code editor is refreshed and the code that I have written is wiped off. I have tried all the possible hooks but I want to know how to render the same code editor. I'm not sure why this is happening as I am not changing the state of Sandpack editor or provider. The buttons is just an example, basically what I want to achieve is a segment so a user can toggle between the preview and the console. I have also tried using useActiveCode but I lose the code the moment button is clicked and the whole sandpack is re-rendered except the preview.
Beta Was this translation helpful? Give feedback.
All reactions