I'm have a list of objects
{id: 182, symbol: 'ETHUSDT', recommended_to_buy_qty: '42.83213', current_qty_in_portfolio: '8.06928'}
{id: 183, symbol: 'XRPUSDT', recommended_to_buy_qty: '83.47332', current_qty_in_portfolio: '8.79834'}
{id: 184, symbol: 'ADAUSDT', recommended_to_buy_qty: '50.72704', current_qty_in_portfolio: '3.79095'}
I need to sum two values in array with onChange input
On every change values is summed
const [inputValue, setInputValue] = useState(0)
function handleChange(e) {
e.preventDefault();
setInputValue(e.target.value);
}
I'm create input form and it's works but change all my mapped values at once
<Form.Control onChange={handleChange} value={inputValue} />
How can i change only one item in array at once on every onChange event?
handleChange()doesn't do any summing, where is that logic?sumvalues look like? Which property of your object list are you trying to manipulate?