react-final-form-arrays icon indicating copy to clipboard operation
react-final-form-arrays copied to clipboard

Question : How update a line

Open anthony-bernardo opened this issue 6 years ago • 1 comments

Is there a way to update the value of a line ?

Now I'm using :

let guestCopy = fields.value[index];
guestCopy.bookingOwner = true;

fields.remove(index);
fields.insert(index, guestCopy);

But it's a little bit dirty

anthony-bernardo avatar Nov 29 '18 14:11 anthony-bernardo

@xero88 #63 is basically documenting the already existing function called update it allows you to update the field in a clean way, just like you wish for 😄

so to implement your booking code, just do:

fields.update(index,guestCopy)

shirbr510 avatar Jan 09 '19 18:01 shirbr510