I have retrieved datas stored using useState in an array of object, the datas was then outputted into form fields. And now I want to be able to update the fields (state) as
You can do this without mutation by mapping your old array into a new one, swapping what you want to change for an updated item along the way.
setDatas( datas.map(item => item.id === index ? {...item, someProp : "changed"} : item ))