-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
presumed: Strict mode react issue on load #893
Labels
Comments
I also encountered the same bug with strict react mode. :( |
Hi ! did you find a reasonable workaround ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I've developed a typescript wrapper for the component.
I suspect that, because strict mode react invoke effects twice, the initialization process of TuiImageEditor fails.
I've an error on
this._invoker.on(EXECUTE_COMMAND, function (command) {
return _this2.ui.fire(EXECUTE_COMMAND, command);
});
when image is first loaded.
Ui is null.
I suppose that destroy is resetting it.
To Reproduce
`import React, {useEffect, useRef} from "react";
import TuiImageEditor from "tui-image-editor";
import "tui-image-editor/dist/tui-image-editor.css";
import "tui-color-picker/dist/tui-color-picker.css";
import "./imageEditor.scss";
export const ImageEditor = ({imageDataUrl}: { imageDataUrl: string }) => {
const containerRef = useRef(null);
const imageEditorRef = useRef<TuiImageEditor | null>(null);
};`
Expected behavior
I expect initialization to stop on destroyed components.
The text was updated successfully, but these errors were encountered: