-
-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow render speed for complex forms #19
Comments
And actually this approach doesn't work if I need to change form state outside of specific input field (for example load data to form on button click) |
How does your form grow? Do you simply have a lot of inputs? Or do you have extremely deep objects as your values? |
I have form which is built based on values it has, with ability to add new values. For example I've found the you provide access to formAPI via context, so this solved my problem for now. I still need to store input value somewhere (outside of form state), to be able to compare current formValue (accessible via context formAPI) with previous (stored inside of input component). Don't think it's possible to speed it up without Anyway, if you have better approach, let me know :) |
Yeah, optimizing for extremely large forms here would potentially touch all points of the library, so I think we need to ponder how we would accomplish this a bit more before we go diving in :) Closing this issue for now since you were able to skirt around things with access to the internal state, but let's keep the discussion going as we find better ways to optimize things. |
I've encountered issue with pretty complex form being slow to render (because all form parts are re-rendered).
I've solved it with custom defined Inputs, where form value is stored in custom input state. Using this state I can compare it with nextState in shouldComponentUpdate.
So as you see, I need to keep internal custom form input state in sync with react-form state. And thats not the best solution in my opinion. I'm doing this because I didn't find any other way to get input value inside shouldComponentUpdate (manually passing getValue function to each input is not ideal too).
Do you have any suggestions on how to improve this case?
Could be related to #4 and #5
The text was updated successfully, but these errors were encountered: