Course lesson
Add state to functional React component with useState hook without introducing a class
Most React developers knows the pain of refactoring a functional component only because we would like to add a state to it.
- Duration
- 1 min
- Access
- Free
- Transcript
- Available
Most React developers knows the pain of refactoring a functional component only because we would like to add a state to it.
In this lesson we are going to learn a new way of handling that - React 16.7 alpha introduces a concept of hooks, which allow us to well... hook into existing React features (such as state) from inside of a functional component. By using a useState hook we introduce state to a Counter component without introducing a class.