marmelab / react-admin

A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design
http://marmelab.com/react-admin
MIT License
24.89k stars 5.24k forks source link

Rerender Issue after image upload #9180

Closed abhishekrup closed 1 year ago

abhishekrup commented 1 year ago

Hii, I am getting a re-render issue when i am uploading image inside Edit in react-admin As soon as i am uploading the image from file manager it gets re-render and uploaded image gets removed and also you can see in video when i am clearing the console and clicking on the screen then also it gets re-render i am uploading the video and also the code. Need a solution

const EditForm1 = () => {
    return (
        <FileInput source="attachments">
            <FileField source="src" title="title" />
        </FileInput>
    )
}

const ComplaintManagementsEdit = ({ ...props }) => {
 <SimpleForm toolbar={<EditToolbar />}>
            <EditForm1 />
        </SimpleForm>
}

"react": "18.2.0", "react-admin": "^4.11.3",

https://github.com/marmelab/react-admin/assets/134288913/106dbfdb-7ee4-4ee3-b524-4c6d9e221ef5

fzaninotto commented 1 year ago

I cannot reproduce the issue you describe in the simple example Stackblitz:

https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple?file=src%2Fposts%2FPostEdit.tsx

Click on a post in the list, click on the "related pictures" area in the post edition form, attach a picture, and it appears.

Could you please fork this stackblitz and modify it to demonstrate the issue?

abhishekrup commented 1 year ago

Ok so i have a screen of edit with tag and under that so under simpleForm i have called a function of EditForm and under that i have a option of file upload, so as soon as i upload new file the screen gets render and it started showing old data again also if i click anywhere outside the screen and then again click on screen at that time also it renders the screen you can see it on the video uploaded above I am uploading below my file in which i am getting the issue renderEditForm.js.zip

fzaninotto commented 1 year ago

This is not enough for us to investigate, we need to be able to run a project that reproduces the issue. Please tweak the aforementioned StackBlitz until you can reproduce the issue.

fzaninotto commented 1 year ago

No news for some time, closing.