Answer the question
In order to leave comments, you need to log in
How to edit a large amount of data in an array?
I have a dynamic array stored in a state in which the nth number of objects is: [{name: "example", id:45, {}...], Each object is 1 input, An event is hung on each field to change fields by id , but due to a large number of sets and changing an immutable array by copying it, ui starts to slow down, how can I prevent this, or what am I doing wrong? And also the search is carried out by id, is it better to use index instead of id? I will be very grateful for your help.
Answer the question
In order to leave comments, you need to log in
You can make an object from an array, whose keys will be the id of the array element
[{id: 45, name: "example"}] -> {45: {id: 45, name: "example"}}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question