SlideShare a Scribd company logo
React Hooks
João Marins & Caio Flores
João Marins
@jgcmarins @jgcmarins
2
Caio Flores
@caioflores @caiopflores
3
Notice
4
This is not the official documentation.
React Hooks are in alpha version.
Topics
5
- Motivation
- Proposal + RFC
- React Core
- What are hooks?
- Function x Class
components
- Hooks API
- When/How to use?
- When/How not to use?
- Should I refactor?
- Examples
- Opportunities
6
Motivation
- It’s hard to reuse stateful logic between
components
- Complex components become hard to
understand
- Classes confuse both people and
machines
Motivation
7
“Hooks let you use more of React’s
features without classes.”
Proposal + RFC
8
https://github.com/reactjs/rfc
s/pull/68/
React Core
9
https://github.com/facebook/
react/pull/13968/
10
What are hooks?
“Hooks are functions that let you ‘hook
into’ React state and lifecycle features
from function components.”
11
But what are Function
Components?
12
Function x Class components
Hooks API: Initial implementation
13
- useState
- useContext
- useEffect
- useRef
- useReducer
- useCallback
- useMemo
- useAPI
When/How to use?
14
- Only call hooks from React Functions
- Share state management logic
When/How to use?
15
Before you ask me...
16
When/How not to use?
17
Hooks can be dangerous
When/How not to use?
18
Do not use it inside:
- Loops
- Conditions
- Nested functions
and …
- Hooks
Should I refactor my
codebase?
19
Examples
20
More examples
21
- https://github.com/jgcmarins/react-hooks-
examples
- https://github.com/caioflores/react-hook-
examples
Opportunities
22
- Blog posts
- Libraries
- Learn more about
react core
What is next?
23
Concurrent Mode
&
Suspense for Data Fetching
&
More functional programming
24
https://reactjs.org/blog/2018/11/27/react-16-roadmap.html
- https://reactjs.org/docs/hooks-intro.html
- https://reactjs.org/docs/hooks-overview.html
- https://reactjs.org/blog/2018/11/27/react-16-roadmap.html
- https://blog.kentcdodds.com/useeffect-vs-uselayouteffect-vs-
usemutationeffect-6a3ee231304a
- https://github.com/este/este/tree/master/hooks
- https://github.com/jaredpalmer/formik/pull/1063
- https://medium.com/@ryardley/react-hooks-not-magic-just-arrays-
cd4f1857236e
Links
25
Thanks!!!
26
Give me a feedback about this talk
27

More Related Content

What's hot (20)

PPTX
Angular modules in depth
Christoffer Noring
 
PPTX
Intro to React
Justin Reock
 
PPTX
Reactjs
Mallikarjuna G D
 
PPTX
Introducing Swagger
Tony Tam
 
PDF
Documenting your REST API with Swagger - JOIN 2014
JWORKS powered by Ordina
 
PDF
Important React Hooks
Knoldus Inc.
 
PDF
ReactJS presentation
Thanh Tuong
 
PPTX
Introduction to spring boot
Santosh Kumar Kar
 
PPTX
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
PDF
API for Beginners
Sébastien Saunier
 
PDF
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
PPTX
React + Redux Introduction
Nikolaus Graf
 
PDF
React Context API
NodeXperts
 
PPTX
Understanding react hooks
Maulik Shah
 
PDF
JavaScript Programming
Sehwan Noh
 
PPTX
React Hooks
Erez Cohen
 
PPTX
Intro to React
Eric Westfall
 
PPTX
Its time to React.js
Ritesh Mehrotra
 
PPTX
Introduction to React JS for beginners | Namespace IT
namespaceit
 
PPTX
[Final] ReactJS presentation
洪 鹏发
 
Angular modules in depth
Christoffer Noring
 
Intro to React
Justin Reock
 
Introducing Swagger
Tony Tam
 
Documenting your REST API with Swagger - JOIN 2014
JWORKS powered by Ordina
 
Important React Hooks
Knoldus Inc.
 
ReactJS presentation
Thanh Tuong
 
Introduction to spring boot
Santosh Kumar Kar
 
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
API for Beginners
Sébastien Saunier
 
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
React + Redux Introduction
Nikolaus Graf
 
React Context API
NodeXperts
 
Understanding react hooks
Maulik Shah
 
JavaScript Programming
Sehwan Noh
 
React Hooks
Erez Cohen
 
Intro to React
Eric Westfall
 
Its time to React.js
Ritesh Mehrotra
 
Introduction to React JS for beginners | Namespace IT
namespaceit
 
[Final] ReactJS presentation
洪 鹏发
 

Similar to React Hooks (20)

PPTX
React Hooks
Caio Flores
 
PDF
React hooks beyond hype
Magdiel Duarte
 
PDF
React.js hooks feb 23rd meetup
Jaikant Kumaran
 
PDF
Basics of React Hooks.pptx.pdf
Knoldus Inc.
 
PDF
Introduction to React Hooks
Felicia O'Garro
 
PDF
Understanding react hooks
Samundra khatri
 
PDF
Hello, React Hooks!
Heejong Ahn
 
PDF
React hooks Episode #1: An introduction.
ManojSatishKumar
 
PDF
How do we use hooks
Jim Liu
 
PPTX
Green Custard Friday Talk 21: React Hooks
Green Custard
 
PDF
React – Let’s “Hook” up
InnovationM
 
PDF
Understanding React hooks | Walkingtree Technologies
Walking Tree Technologies
 
PDF
React Hooks: Enhancing Functional Components with useState, useEffect, and Cu...
Akshat Pegwar
 
PPTX
React hooks
Sadhna Rana
 
PPTX
Pluginkla2019 - React Presentation
Angela Lehru
 
PPTX
Hook me UP ( React Hooks Introduction)
Carlos Mafla
 
PDF
Importance of Hook in Recat Js.pdf
Nishaadequateinfosof
 
PDF
Road to react hooks
Younes (omar) Meliani
 
PDF
React hooks Webinar slides
Manish Kumar
 
PPTX
TRAINING pptt efwoiefo weoifjoiewjfoifjow.pptx
PrathamSharma77833
 
React Hooks
Caio Flores
 
React hooks beyond hype
Magdiel Duarte
 
React.js hooks feb 23rd meetup
Jaikant Kumaran
 
Basics of React Hooks.pptx.pdf
Knoldus Inc.
 
Introduction to React Hooks
Felicia O'Garro
 
Understanding react hooks
Samundra khatri
 
Hello, React Hooks!
Heejong Ahn
 
React hooks Episode #1: An introduction.
ManojSatishKumar
 
How do we use hooks
Jim Liu
 
Green Custard Friday Talk 21: React Hooks
Green Custard
 
React – Let’s “Hook” up
InnovationM
 
Understanding React hooks | Walkingtree Technologies
Walking Tree Technologies
 
React Hooks: Enhancing Functional Components with useState, useEffect, and Cu...
Akshat Pegwar
 
React hooks
Sadhna Rana
 
Pluginkla2019 - React Presentation
Angela Lehru
 
Hook me UP ( React Hooks Introduction)
Carlos Mafla
 
Importance of Hook in Recat Js.pdf
Nishaadequateinfosof
 
Road to react hooks
Younes (omar) Meliani
 
React hooks Webinar slides
Manish Kumar
 
TRAINING pptt efwoiefo weoifjoiewjfoifjow.pptx
PrathamSharma77833
 
Ad

Recently uploaded (20)

PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Tally software_Introduction_Presentation
AditiBansal54083
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Ad

React Hooks