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
Following the changes introduced in #11143, our application now freezes when opening a form.
In our application, we receive binary data as a Uint8Array from the backend and pass it to useForm as defaultValues. Additionally, useForm returns isDirty. Since the aforementioned change, _getDirty uses deepEqual to compare the defaultValues, which contain identical data during the initialization of useForm. This results in a very heavy process due to the comparison of large, identical arrays, causing the application to freeze.
I have two questions regarding this:
Is it by design that useForm compares defaultValues to return isDirty during initialization?
Is it considered an anti-pattern to handle data such as Uint8Array with React Hook Form?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Following the changes introduced in #11143, our application now freezes when opening a form.
In our application, we receive binary data as a Uint8Array from the backend and pass it to
useForm
asdefaultValues
. Additionally,useForm
returnsisDirty
. Since the aforementioned change,_getDirty
usesdeepEqual
to compare thedefaultValues
, which contain identical data during the initialization ofuseForm
. This results in a very heavy process due to the comparison of large, identical arrays, causing the application to freeze.I have two questions regarding this:
useForm
comparesdefaultValues
to returnisDirty
during initialization?Thank you for your assistance.
Here is a sample code snippet:
Beta Was this translation helpful? Give feedback.
All reactions