DEMO SKYLAB CODERS ACADEMY

WTF are React Hooks?

Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class

 

Hooks are:

 

  • Completely opt-in. You can try Hooks in a few components without rewriting any existing code.
     
  • 100% backwards-compatible. Hooks don’t contain any breaking changes.

 

Motivation

 

  • It’s hard to reuse stateful logic between components. Before Hooks: HOCs, renderProps & Mixins.
     
  • Complex components become hard to understand.
  • Classes confuse both people and machines.

REACT HOOKS DEMO SKYLAB

By Àlex Barba

REACT HOOKS DEMO SKYLAB

  • 87