PromucFlow_constructor/app/client/src/widgets/JSONFormWidget/fields
Ashit Rath 827f22e487
perf: JSONForm infinite re-rendering when field validation is set (#35994)
## Description
The setError function updates the state and the effect is also dependant
on the state which triggers re-render. This is a classic case of
re-rendering due to self state dependency and is fixed with a check if
the error is present for a particular field then it doesn't need to set
again

Fixes https://github.com/appsmithorg/appsmith/issues/35995

## Automation

/ok-to-test tags="@tag.JSONForm"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10627924838>
> Commit: 1d5dec675abd788931aab462832455fbce250df3
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10627924838&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.JSONForm`
> Spec:
> <hr>Fri, 30 Aug 2024 06:50:40 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced error handling logic in the form validation process to
improve efficiency and correctness.
  
- **Tests**
- Added a new test case to validate the behavior of the form validation
hook when encountering invalid field states.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-08-30 16:44:55 +05:30
..
ArrayField.test.tsx chore: enable no-explicit-any rule (#35321) 2024-07-31 18:41:28 +03:00
ArrayField.tsx chore: adding telemetry for klona (#35918) 2024-08-29 12:35:48 +05:30
BaseInputField.tsx fix: change appsmith alias (#35349) 2024-08-06 17:52:22 +03:00
CheckboxField.tsx chore: Move the widget config to widget class (#26073) 2023-09-06 17:45:04 +05:30
CurrencyInputField.test.ts
CurrencyInputField.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
DateField.tsx chore: Move the widget config to widget class (#26073) 2023-09-06 17:45:04 +05:30
FieldRenderer.tsx chore: enable no-explicit-any rule (#35321) 2024-07-31 18:41:28 +03:00
index.ts
InputField.test.ts
InputField.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
MultiSelectField.tsx
ObjectField.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
PhoneInputField.test.ts
PhoneInputField.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
RadioGroupField.tsx
SelectField.test.tsx
SelectField.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
SwitchField.tsx chore: Move the widget config to widget class (#26073) 2023-09-06 17:45:04 +05:30
useBlurAndFocusEvents.ts chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
useObserveAccessor.ts chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
useRegisterFieldValidity.test.tsx perf: JSONForm infinite re-rendering when field validation is set (#35994) 2024-08-30 16:44:55 +05:30
useRegisterFieldValidity.ts perf: JSONForm infinite re-rendering when field validation is set (#35994) 2024-08-30 16:44:55 +05:30
useUpdateInternalMetaState.ts chore: adding telemetry for klona (#35918) 2024-08-29 12:35:48 +05:30