Closed stylessh closed 1 year ago
@stylessh, could you reproduce the issue in the codesandbox? There is my attempt.
hey @Norserium, thanks a lot for your response. That is what I want to achieve, but instead I want to restore the previous state when the Cropper is mounted again. If you want I can create a codesandbox
@stylessh, I assume, that you trying to set state before the cropper loads an image.
To facilitate the implementing of the desired result, you can use the fields from the saved state and pass them to defaultCoordinates
, defaultVisibleArea
and defaultTransforms
.
The codesandbox may be useful.
I'll try and let you know
Got it working now man, thanks a lot. Check out the example here so it might help someone in the future.
Now when you save the state, and remount the component, it takes the saved state by default.
@stylessh, you are welcome!
Hello! I want to save the editor state so when I remount it, it saves the previous changes. But it doesn't seem to work.
editorState is the saved state.
Here is where I "get" the value store on the useState, but it has the default state anyway.
Any idea on how can I achieve this?