Recently I write my React JS app to import images from outside and process that image. In order to handle the user onChange event, I use onChange to run my function handleChange, but it won't work for the second time. How can I handle the onChange event properly? Here is my code
<div className={classes.fileUpload}> <div style={{ position: "relative", display: "inline-block", height: "100%", width: "100%", }} > <input type={"file"} id="file" accept={"image/png, image/jpeg"} style={{ display: "none" }} onChange={(e) => handleChange(e.target.files)} /> <label htmlFor="file" className={classes.labelFile}> <PublishIcon style={{ marginRight: "10px" }} /> Upload file </label> </div> </div>