craft.js
craft.js copied to clipboard
how to reset pointer of history
when update data of Frame by call api from server , the pointer of history be changed and timeline not empty .
Currently, we don't have a way to clear the history stack in the latest stable version of Craft. But if you're using the alpha yarn install @craftjs/core@next
(which is version 0.3.x), there's a method that allows you to clear the history stack -> https://github.com/prevwong/craft.js/blob/next/packages/utils/src/History.ts#L109
Usage:
const { store } = useEditor();
store.history.clear();
Note: This above code is still experimental