Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In reactjs in below program how can we assign \'c\' using setState. Please sugge

ID: 3887367 • Letter: I

Question

In reactjs in below program how can we assign 'c' using setState. Please suggest me the correct syntax. HandleSubmit is called in onClick for a button.

handleSubmit=(event) => {

event.preventDefault();

var v= validator(this.state, this.constraints);

if(v){

this.setState(Object.assign(this.state,{error:v}));

console.log(v);

}

else{

if(this.state(actions.permission)=="no")

{

var t=this.props.t;

tet c={};

c=(<div>

<Modal ref="modal">

<h2>Are you sure you want to continue</h2>

<Modal>

<div>);

this.setState(object.assign(this.state,{c}));

}

}

Thanks in advance

Explanation / Answer

hi you can probably do it in this way

this.setState(state1)

hope this works thanks

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote