i have 5 state with 5 function too.. the state value is
imgError: false, imgError2: false, imgError3: false, imgError4: false, imgError5: false,
and the function is
const erroImg = () => {
this.setState({
imgError: true,
})
}
const erroImg2 = () => {
this.setState({
imgError2: true,
})
}
const erroImg3 = () => {
this.setState({
imgError3: true,
})
}
const erroImg4 = () => {
this.setState({
imgError4: true,
})
}
const erroImg5 = () => {
this.setState({
imgError5: true,
})
console.log('tes')
}
the question is,, how can i use one function for change the five state ??