Skip to content

Instantly share code, notes, and snippets.

@ljmotta
Created October 13, 2020 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmotta/52ba6116e1cc416751d1567703d011eb to your computer and use it in GitHub Desktop.
Save ljmotta/52ba6116e1cc416751d1567703d011eb to your computer and use it in GitHub Desktop.
Base64Png Editor setContent State Control
/**
* Clear the state control stack, and rollback the Editor tweak states to the initial values.
*/
const setContent = useCallback((path: string, content: string) => {
setOriginalContent(content);
stateControl.clearStateControl();
updateEditorToInitialState();
}, [stateControl]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment