score:2

issue

looks like a state mutation in cardhandler

childhandler( update ) {
    const {questions} = this.state;
    let tempqs = questions; // <-- saved current state ref to tempqs
    
    ...

    tempqs[temp[0]-1].question = temp1[1]; // <-- mutated state ref
    tempqs[temp1[0]-1].question = temp[1];  // <-- mutated state ref
    this.setstate({questions : tempqs},console.log(questions)); // <-- saved state ref
}

solution

shallow copy questions into new array reference to update. this should allow react's state/props reference test to detect that state is a new object and rerender.

const {questions} = this.state;
let tempqs = [...questions]; // <-- spread existing array into new array

Related Query

More Query from same tag