Setting state in class components | Class Components in React tutorial

Опубликовано: 30 Сентябрь 2024
на канале: Scrimba
8,635
159

🎓 View our courses: https://scrimba.com/links/all-courses

We set state in class components using this.setState.

Any class methods you create that need to call the this.setState method (which is available to our component because we're extending React.Component) should be declared as an arrow function.

💜 Play with this code on Scrimba: https://scrimba.com/learn/classcompon...

💻 Check out Scrimba’s interactive learning platform:
https://scrimba.com/

🌲 Linktree:
https://scrimba.com/links/linktree