Why is the parent component rerendering when I call the useFieldArray methods? #7678
Replies: 3 comments 2 replies
-
|
Hi there, could you create a codesandbox showing the issue happening? If so I will happily take a look, as I am interested in field arrays 🙂 |
Beta Was this translation helpful? Give feedback.
-
|
Alright, I've reproduced it without the MUI lib. const { errors } = formStateYou can see this behavior in this CSB. field-array-state-rerender.mp4 |
Beta Was this translation helpful? Give feedback.
-
|
if you subscribed |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I use version 7.25.1
When I add a new question, there is a re-render in the parent component. However, this was not the case in version 6, if you look at this codesandbox.
Below I have shown only the form for adding questions. But in my project, there is an array of answers for each question. When I add a new answer, it re-renders again in the "Container" component. I did everything, as in codesandbox from the link above.
The parent component looks like this:
Component where I add "questions":
What am I doing wrong? When I add a lot of questions and answers to the form, it starts to slow down a lot.
Beta Was this translation helpful? Give feedback.
All reactions