I am using a fontAwesome icon on a button and it seems that sometimes my code correctly uses the value of the button element and sometimes looks for the value of the icon (i tag element) when the button is clicked. the following combination:
<button id="break-decrement"
value="-"
onClick={this.handleBreakTime}> <i class="fas fa-angle-double-down"></i>
</button>
handleBreakTime() {
let length = this.state.breakLen;
let value = event.target.value;
console.log(value);
console.log(event.target.value);
console.log(event.currentTarget.value);
}
logs this to the console when I don't click the icon: "-" "-" undefined
but logs this when I do click the icon: undefined undefined undefined
Is there a way to consistently get the value of the button when the icon is clicked on.