-
-
Notifications
You must be signed in to change notification settings - Fork 71
Significant performance degradation when using react-final-form-arrays #22
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
Comments
Hmm.. I hated adding that Perhaps it will have to be revisited and thought about some more. 🤔 |
Having a big performance issue also, at least 1 second to render on input. Tried with 50 fields in my array, and each field is composed of 2 text inputs and some styled components. Perf profile is pointing to https://github.com/final-form/react-final-form-arrays/blob/master/src/FieldArray.js#L127 Do you have any recommendations ? How could I avoid re-rendering the whole list on user input ? |
same issue here |
Yes I'm trying to used posed animations and it's really bad... A list with 3 items and only a couple field still has 2+ seconds or delays and blocking |
Any update on this? |
The issue has not yet been fixed (final-form-arrays-3.0.2 and react-final-form-arrays-3.1.1). The way I was able to work-around the issue is to use React.Memo to memorize the component to reduce re-rendering (props only included values that were used in rendering of ExpantionPannel const Test3 = React.memo((props)=> {
const classes = useStylesExpantionPanel();
return (<React.Fragment>
<ExpansionPanel>
<ExpansionPanelSummary expandIcon={<ExpandMoreIcon />} >
<Typography className={classes.heading}>Title</Typography>
</ExpansionPanelSummary>
<ExpansionPanelDetails>
<TextInput source={`${props.source}.minWidth`} label="Min width" resettable />
<TextInput source={`${props.source}.maxWidth`} label="Max width" resettable />
<TextInput source={`${props.source}.minHeight`} label="Min height" resettable />
<TextInput source={`${props.source}.maxHeight`} label="Max height" resettable />
<TextInput source={`${props.source}.width`} label="Width" resettable />
<TextInput source={`${props.source}.height`} label="Height" resettable />
</ExpansionPanelDetails>
</ExpansionPanel>
</React.Fragment>
);
},
(prevProps, nextProps)=> {console.log({prevProps, nextProps}); return _.isEqual(prevProps, nextProps)}
) This way, when other form control are updated using user input, no re-rendering is taking place since this form is not re-rendered. |
The project I'm working on has some large forms with dynamically generated nested field arrays so I figured I'd throw my experience out there in case it helps others. We were able to signifcantly improve overall form performance by setting the subscription and validateField props on appropriate elements. Out of the box final-form can re-render the form and individual fields a lot. That usually isn't a problem until you add arrays, nesting, or a lot of fields. A couple of quick examples:
|
I have a lot of forms in expansion panel and all of them have arrays in them. I am seeing significant performance impact . On further investigation looks like Chrome performance timeline tool is pointing towards
react-final-form-arrays.es.js:289
which is significantly slowing down user experience . From the time user clicks and the changes show up on screen is a lot.@erikras Do you have any thoughts on how I can improve the experience.
The text was updated successfully, but these errors were encountered: