React Hooks

What?

Why?
How?
WTF?

What?

Hooks are functions

'hook' into lifecycle methods

Why?

Classes?

confusing

verbose

not cool anymore

Hooks?

less confusing

less verbose

are cool

😎

How?

Rules

Hooks must be at top level

Only within React functional components

😎

Demo

Context

Tinder Jr.

Cool Baby?

Judge babies entirely on looks

Cool Baby?

Judge babies entirely on looks

...

Cool Baby?

Judge babies entirely on looks

...

with hooks

😎

Actual Demo

WTF?!?

Testing

Wrong!

Wrong!

useCallback

eslint-plugin-react-hooks

Container / Component

Smart and dumb components

Questions?

😎

React Hooks

By dijonmusters

React Hooks

  • 246