isMain = (v, k) => {
let {avatars: {fields}, push} = this.props;
fields.getAll().map((avatar, key) => {
fields.remove(key);
push('avatars', {
deleteImage: avatar.deleteImage || false,
uuid: avatar.uuid,
fileName: avatar.fileName,
url: avatar.url,
setMain: key === k,
});
});
};
This is how I try^ Doesn't work, I don't know why
I use v6
I also tried insert
But with insert field not removed only - copied! Although the value of new fields changed