React Hooks in 1 minute

Yoko Spirig
1 min readMar 19, 2019

This is how you write a component with a state with the React framework traditionally. Notice the state variable on the second line.

This is how you write a component with a state with React Hooks. Notice that there’s no state variable defined.

You see that the only difference is, with React Hooks you don’t define a state variable but, instead, the function useState, included in the React framework, does it for you. That’s very basically what React Hooks does.

--

--