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
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.
Uh oh!
There was an error while loading. Please reload this page.
-
setValue from useForm not updating too, reset not updating too.
export const CustomArrayInput = ({ className, keyLabel, valueLabel, keyName, keySubLabel, valueSubLabel, keyValue, isRequired, keyPlaceholder, valuePlaceholder }: any) => {
const { field }: any = useController({ name: 'headers', rules: { required: 'The field is required' } });
// NEED TO UPDATE ALREADY FETCHED VALUES=> my values are {"a": "b"} need to do [{"headerName": "a", "headerValue" : "b"}]
useEffect(() => {
const newValue: { headerName: string; headerValue: any; }[] = []
Object.keys(field.value).forEach(el => {
newValue.push({ 'headerName': el, 'headerValue': field.value[el] })
});
// NOOOOOOOT UPDATING
field.onChange(newValue)
}, []);
}
Beta Was this translation helpful? Give feedback.
All reactions