You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
Starting with release 1.16.11, the library started calling clearGetFormCacheForModel within the mapStateToProps method of the Form component.
Because mapStateToProps gets called anytime an action is dispatched, the formKey cache is constantly getting cleared.
Without the cache, the way the form key is determined is by iterating through keys of the store, which gets progressively not-performant as the size of the store grows.
I'll look into putting up a PR to address the issue. My immediate thought is to expose createFormClass here:
The Problem
When using react-redux-form inside of a large redux store, form performance is slow.
Steps to Reproduce
Expected Behavior
Actual Behavior
Reproducible Code Example
https://codepen.io/nyknicksfan10033/pen/KKpGBNj?editors=0010
Additional Information
Previously, our codebase had been using version 1.16.5 of react-redux-form, and we had no issues with performance.
When we attempted to upgrade to the latest version, 1.16.14, we saw a great deal of performance issues.
After debugging a little, it seems that the culprit is here:
react-redux-form/src/components/form-component.js
Lines 410 to 413 in 877b08a
Starting with release 1.16.11, the library started calling
clearGetFormCacheForModel
within themapStateToProps
method of theForm
component.Because
mapStateToProps
gets called anytime an action is dispatched, the formKey cache is constantly getting cleared.Without the cache, the way the form key is determined is by iterating through keys of the store, which gets progressively not-performant as the size of the store grows.
I'll look into putting up a PR to address the issue. My immediate thought is to expose
createFormClass
here:react-redux-form/src/components/form-component.js
Lines 430 to 432 in 877b08a
in the index.js file, and provide options to /not/ clear the cache on every render, but any thoughts / feedback is welcome. Thanks!
The text was updated successfully, but these errors were encountered: