setValue1 () {
this.setState({ value: (this.state.value + 1).slice(0, 3) })
}
setValue2 () {
this.setState({ value: (this.state.value + 2).slice(0, 3) })
}
setValue3 () {
this.setState({ value: (this.state.value + 3).slice(0, 3) })
}
setValue4 () {
this.setState({ value: (this.state.value + 4).slice(0, 3) })
}
setValue5 () {
this.setState({ value: (this.state.value + 5).slice(0, 3) })
}
setValue6 () {
this.setState({ value: (this.state.value + 6).slice(0, 3) })
}
setValue7 () {
this.setState({ value: (this.state.value + 7).slice(0, 3) })
}
setValue8 () {
this.setState({ value: (this.state.value + 8).slice(0, 3) })
}
setValue9 () {
this.setState({ value: (this.state.value + 9).slice(0, 3) })
}
setValue0 () {
this.setState({ value: (this.state.value + 0).slice(0, 3) })
}
reset () {
this.setState({ value: '' })
}
const addNumber = number => {
return () => {
setValue(prevValue => (prevValue + number).slice(0, 3));
};
};
const reset = () => {
setValue(initialValue);
};