chore: ensures array fields update modified state

This commit is contained in:
James
2022-04-26 10:19:39 -04:00
parent 2d14ab1217
commit 1cdd5b96b3

View File

@@ -90,7 +90,8 @@ const ArrayFieldType: React.FC<Props> = (props) => {
const removeRow = useCallback((rowIndex) => {
dispatchRows({ type: 'REMOVE', rowIndex });
dispatchFields({ type: 'REMOVE_ROW', rowIndex, path });
}, [dispatchRows, dispatchFields, path]);
setValue(value as number - 1);
}, [dispatchRows, dispatchFields, path, value, setValue]);
const moveRow = useCallback((moveFromIndex, moveToIndex) => {
dispatchRows({ type: 'MOVE', moveFromIndex, moveToIndex });