Hi all. I’m currently building the calculator project with React, and I can’t make my buttons work when I click them, except for my “delete” and “clear” keys (which have their own dedicated functions). My buttons are not child components, so that might be making things more difficult. Here’s essentially what I have right now:
The function for handling the click:
"handleStandard = (value) => (
this.setState({
input: this.state.input + value
})
);"
I’ve tried variations of the following with little success:
"<button
id='one'
value='1'
onClick={() =>this.handleStandard(this.value)}></button>"
Basically, I want to get the ‘value’ on the button to be passed as the ‘value’ argument on my handleStandard function.
I’m probably missing something somewhat simple, right? Any suggestions?
Thanks.