Unable to use basic ImageEditor with react

Hi, I created a basic react app following this tutorial - https://ej2.syncfusion.com/react/documentation/image-editor/getting-started

I see just the image upload button, and when I upload the image, the actual image component doesnt show up. I can see control buttons, but not the image thats being modified.


What am i doing wrong?


Before selecting image

Screenshot 2023-06-08 at 9.33.38 PM.png


After selecting an image

Screenshot 2023-06-08 at 9.33.33 PM.png


"@syncfusion/ej2-react-image-editor": "^21.2.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",


index.html

<body>
<div id="root">
<div id='image-editor'>
<div id='loader'>Loading....div>
div>
div>

body>

App.tsx

import { ImageEditorComponent } from '@syncfusion/ej2-react-image-editor';
import { createRoot } from 'react-dom/client';
import "./App.css";

function App() {

return (
<div id="wrapperDiv">
<ImageEditorComponent/>
div>
);
}

export default App;

createRoot(document.getElementById('image-editor')!).render(<App />);



App.css


@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../node_modules/@syncfusion/ej2-image-editor/styles/material.css";


3 Replies 1 reply marked as answer

YA YuvanShankar Arunagiri Syncfusion Team June 9, 2023 04:24 AM UTC

Hi Aayush


We have attempted to replicate the issue on our end but were unable to do so. We have prepared a sample based on your provided code snippet. Refer to the below sample link.


Sample link: https://stackblitz.com/edit/react-qtnnjw?file=index.js


If you still facing the issue, could you please share the issue replicable sample or replicate issue in our sample. Based on that we will check and provide you a better solution quickly.


Regards,

YuvanShankar A



AN Aayush Neupane June 9, 2023 03:38 PM UTC

Hi YuvanShankar, heres my link. The issue is reproduced there too. 


https://stackblitz.com/edit/stackblitz-starters-snb26s?file=src%2FApp.tsx



YA YuvanShankar Arunagiri Syncfusion Team June 12, 2023 06:44 AM UTC

Hi Aayush,


To resolve this issue, kindly set the height and width for image editor component like shown below.


[style.css]:

#wrapperDiv {

  height80vh;

  width100%;

}


Sample link: https://stackblitz.com/edit/stackblitz-starters-qjb93k?file=src%2Fstyle.css,src%2Findex.tsx


Get back to us if you need any further assistance on this.


Marked as answer
Loader.
Up arrow icon