Q. What is the correct way to update state based on the previous state?

पिछली स्थिति के आधार पर स्थिति को अपडेट करने का सही तरीका क्या है?

A
this.setState({ count: count + 1 })
B
this.setState(prevState => ({ count: prevState.count + 1 }))
C
this.state.count++
D
this.setState({ count: this.state.count + 1 })

Explanation

Explanation will be available soon. Please stay tuned.

व्याख्या जल्द ही उपलब्ध होगी। कृपया बने रहें।

Invest in Future Achievers

Your support helps keep Exam Achiever 100% free for students preparing for exams.

Thanks for your support!

Comments

Leave a Comment