S
S
Sanchik972020-06-22 09:29:41
React
Sanchik97, 2020-06-22 09:29:41

How to make dynamic, controlled inputs and change the key - value of an object in an array?

Hello! An array of objects is stored in the state, when a button is pressed, a new object is added to the array and a pair of inputs is rendered, one is responsible for changing the key of this object, the second for changing the value of the object. The task of adding and removing objects from an array is clear, but it is not clear how to make controlled inputs with a change in the object key. How can this be implemented?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question