5 Ways to Convert React Class Components to Functional Components w/ React Hooks
In the latest alpha release of React, a new concept was introduced, it is called Hooks. Hooks were introduced to React to solve many problems as explained in the introduction to Hooks session however, it primarily serves as an alternative for classes. With Hooks, we can create functional components that uses state and lifecycle methods.
Related Reading:
Getting Started with React Hooks
Build a React To-Do App with React Hooks (No Class Components)
Hooks are relatively new, as matter of fact, it is still a feature proposal. However, it is available for use at the moment if you'd like to play with it and have a closer look at what it offers. Hooks are currently available in React v16.7.0-alpha.
It's important to not that there are no plans to ditch classes. React Hooks just ...