Hao

Note for React Doc Reading

Use State Correctly

State Updates May be Asynchronous
  • setState can accept a function rather than an object
this.setState((prevState, props) => ({
  counter: prevState.counter + props.increment
}));
Posted October 25, 2016
READ THIS NEXT:

My Takeaway for React Component Testing

Introduce I have been working with React/Redux since Oct., 2015 at Dataminr in production. Along this journey, there are some takeawayes I gained and would like to share. Hopefully it will help you...


blog comments powered byDisqus