Shuyan Online BLOG
Teens to Learn Programming with Shuyan
Learn Programming with Shuyan
Home
Web Development
Programming
Frameworks
ShuyanOnline Porject
Course: CSS
Misc & Tips
Thursday, September 19, 2019
React: Best practice to setState when setting the value based on previous state
There is another interface to sue
this.setState( (prevState,props)=>{
return {
posts: posts,
counter: prevState.counter + 1
}
}
);
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment