Vue JS hooks and React JS Hooks at a glance (hint: it’s not that complex)
3 min readOct 27, 2018
As React Doc says, Hooks are a new feature proposal that lets you use state and other React features without writing a class. It’s currently in React v16.7.0-alpha and for Vue JS it’s experimental.
Motivation:
The good things about hooks and why you don’t need to be worried are explained below.
- Hooks don’t replace our knowledge of React/Vue concepts.
- There are no plans to remove classes from React/Vue by the creators.
- Crucially, Hooks work side-by-side with existing code so you can adopt them gradually.
- Fully backwards compatible.
The motivations for the Hooks feature proposal are the following ones:
- To reuse the Stateful components logic
- Reducing complexity from components to make it easier to understand
- Get rid of the phenomena “Classes confuse both people and machines”
The idea is to give power to functional components in the React ecosystem. These are the primary reasons why React introduces the hooks and so as VUE the very next day. Now, we’ll be diving to codes using Hooks with both React JS and Vue JS.