I have a modal that's opening in create/edit mode As a prop it has input with object X. X contains properties that are strings or object of strings. Modal has to map this object to input fields, enable editing and return edited object.
How to avoid additional rerender on input change?
I tried to set all children in useEffect on isOpen true, but had a problems with output value.
Right now I am setting object copy by setState in useEffect on prop change and mapping (and then updating) values of local state in modal body, but this approach causes a lot of rerenders.
How can i fix it? Is there a better approach?