You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to reset the history so that Puck rerenders with the change. My use case is that I have a clear history button which wipes localStorage/our DB-saved history and I want Puck to also reset fresh with no history. There's currently no way to do that because setHistories() isn't exposed. I can only set initial and then hard refresh the page.
It's worth noting that even though my setup is causing Puck to rerender, it isn't remounted, so even though initialHistory is updated, the underlying histories aren't.
The text was updated successfully, but these errors were encountered:
This addresses #519.
This change exposes the history store's setHistories and setHistoryIndex
functions. When they are called the data is dispatched so that Puck
rerenders. The use case this supports is when a Puck consumer wants to
change or reset the history state manually without requiring the page to
be refreshed.
---------
Co-authored-by: Chris Villa <chrisvxd@users.noreply.github.com>
It would be nice to be able to reset the history so that Puck rerenders with the change. My use case is that I have a clear history button which wipes localStorage/our DB-saved history and I want Puck to also reset fresh with no history. There's currently no way to do that because setHistories() isn't exposed. I can only set initial and then hard refresh the page.
It's worth noting that even though my setup is causing Puck to rerender, it isn't remounted, so even though initialHistory is updated, the underlying histories aren't.
The text was updated successfully, but these errors were encountered: