Below is my code. I don't think there is any problem.
How can I fool codacy? If I can't use obj[key]
, then what the hell is this thing? There is no way I can avoid []
.
handleClick = (e, titleProps) => {
const { index } = titleProps
const newVal = this.state.activeIndexObj[index]? false: true
let activeIndexObj = {...this.state.activeIndexObj}
activeIndexObj[index] = newVal
// Generic Object Injection Sink (security/detect-object-injection)