I am trying to use a quantity selector component (written by someone else), and onChange I want to reference the new value of the quantity in the callback, but when I use this.value, it doesn't seem to work as shown below (I get a type error undefined in console).
Is there some other way to reference the "new" numerical value of the quantity dropdown?
<QuantitySelector value = {props.itemCartQty} onChange = {() => props.updateItemQty(props.item, this.value)} />
Not sure what is this.value in your example, my guess is selected value. if thats the case, you can pass the event and get the selected value. Can you try the following code and see if it works for you.
updateItemQty(item, event){
var val = event.target.value;
.....
}
<QuantitySelector value = {props.itemCartQty} onChange = {(event) => props.updateItemQty(props.item, event)}
/>