I've been trying to use setState to store multiple values inside an object. Each candidate has all four fields stored inside a solidity array and retrieved using an instance:
   this.state = {
  candidates: {
    Fname: "",
    Sname: "",
    RegNo: "",
    Dept: ""
  }
}
// retrieving the various candidates
this.myInstance.candiNumber().then((candiNum)=> {
    for(let i = 0; i < candiNum; i++){
        this.myInstance.candiArr(i).then((candidate)=>{
            let newCandidate = Object.assign({}, this.state.candidates)
            newCandidate.Fname = candidate[0],
            newCandidate.Sname = candidate[1],
            newCandidate.RegNo = candidate[2],
            newCandidate.Dept = candidate[3]
            this.setState({ newCandidate })
        })
    }
})
My question is; how do I add each candidate to state without replacing the other candidate values?
