Q:

How do I use onChange function after getting data from redux

I have a problem using onChange function, I got the first value (qty is 2), I need to change it, for that I'm using onChange but the value doesn't change.
I already tried to store it to state, and then called it in handlerChange but it doesn't work
This is my State and my Function
class Contra extends React.Component {
    constructor(props) {
        super(props);

        this.state={
            quantity1: ""
        }
        this.handleCancel = this.handleCancel.bind(this);
    }

    handleChangeQuantity(index, e) {
        console.log(index)
        let quantity1 = this.state.quantity1;
        let data = this.props.sendOpenPosValueContra;

        quantity1 = data[index].qty;
        console.log(quantity1)

        this.setState({
            quantity1 : e.target.value
        })

        console.log(quantity1)
    }
}

This props I got the value from redux and I need to change the qty just assume it got qty each are 2

{this.props.sendOpenPosValueContra.map((item, index) => {
    return (
        <tr class="contentbg">
            <td style={{textAlign:"center"}}>{item.item}</td>
            <td style={{textAlign:"center"}}>{item.avail}</td>
            <td>
                <input 
                    type="text"
                    class="tradeDisplay wide"
                    value={item.sell}
                    style={{textAlign:"center"}}
                />
            </td>
            <td style={{textAlign:"center"}}>
                {item.buy}
            </td>
            <td>
                <input
                    value={item.qty} 
                    type="text" 
                    class="tradeInput" 
                    style={{textAlign:"center", font:"bold", width:"100%"}}
                    onChange={this.handleChangeQuantity.bind(this, index)}
                />
            </td>
        </tr>
    )
})}

I expect to be able to change the qty value

A:

class OPOrders extends React.Component{
        constructor(props){
        super(props);

        this.state={
            quantity : "",
            conditionQuantity : false,
        }
        this.handleChangeQuantity = this.handleChangeQuantity.bind(this);
    }
}

handleChangeQuantity(index, e){
        let quantity = this.state.quantity;
        let selectedIndex = index;

        let ming = this.props.sendOpenPosValueContra[selectedIndex].qty = e.target.value;
        this.setState({
            quantity : ming 
        })
    }

