React Cheatsheet — this.setState() – gitconnected

#ReactJS #Cheatsheet  —  this.setState()
Choose the correct lifecycle method

  • React the correct lifecycle methodYou can and should use this.setState() in only these React lifecycle methods: componentDidMount, componentDidUpdate and componentWillReceiveProps.
  • New in React 16, you can also set it in componentDidCatch.React Cheatsheet — using this.setState() in the correct lifecycle methodsThis slide is part of my React workshop.Check out the React documentation or this article for more information about the lifecycle methods and setState().

You can and should use this.setState() in only these React lifecycle methods: componentDidMount, componentDidUpdate and componentWillReceiveProps. New in React 16, you can also set it in…

React the correct lifecycle methodYou can and should use this.setState() in only these React lifecycle methods: componentDidMount, componentDidUpdate and componentWillReceiveProps. New in React 16, you can also set it in componentDidCatch.React Cheatsheet — using this.setState() in the correct lifecycle methodsThis slide is part of my React workshop.Check out the React documentation or this article for more information about the lifecycle methods and setState().

React Cheatsheet — this.setState() – gitconnected