nhn / tui.image-editor

🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
http://ui.toast.com/tui-image-editor
MIT License
6.84k stars 1.26k forks source link

How to use the React library with includeUi set to false ? #875

Open DyRize opened 1 year ago

DyRize commented 1 year ago

Summary I am encountering an issue while using your React library. I can't figure out how to import an image and set up an editing area while passing the includeUi parameter as false.

I have tried several approaches, including the loadImageFromUrl and addImageObject methods, but without success.

How can I use the library without the UI to integrate it directly into my React component?

There seem to be many unanswered questions regarding this topic.

Thank you in advance!

Code

const ImageEditingContent = () => {
  const editorRef = createRef();
  const imagePath = '...';

  return (
    <div className="hk-pt-1">
      <div className="hk-w-140 hk-h-[315px]">
        <ImageEditor
          ref={editorRef}
          includeUi={false}
          cssMaxHeight={315}
          cssMaxWidth={560}
          usageStatistics={false}
        />
      </div>
      <div className="hk-mt-5 hk-m-auto hk-w-fit">
        <></>
      </div>
    </div>
  );
};

Version ^3.15.2