score:4

Accepted answer
const DynamicInputs = ({ inputValues, onUserInputChange }) => {
  const inputs = inputValues.map((value, i) => (
      <input key={i}
             type="text"
             defaultValue={value}
             onChange={e => onUserInputChange(e, i)}/>
  ))
  return (
      <div>
        {inputs}
      </div>
  )
}

Related Query

More Query from same tag