SlideShare a Scribd company logo
Oleksandr Oleksiv
Frontend developer
React Hooks
What are React Hooks?
React Hooks are functions that allow to “power up” your
functional components with class-only features (e.g. state,
lifecycle hooks, etc.)
Functional Class-based
Great for presentation
Properties as input, JSX as output
Single purpose focus Components orchestration
Work with props and state
Hold the business logic
Problems
Wrapper hell
Extending components with new functionality
Lifecycle hooks
Components with Hooks
Easier to maintain
Flexible
Easier to manage lifecycle hooks
Less code
useState(...)
WStateful component
without React hooks
WStateful component
with useState(...) hook
WUse multiple
properties in single
useState(...) hook
useEffect(...)
WStateful component
with lifecycle hooks
The same component,
but with useEffect(...)
hook
useContext(...)
Provider provides
the context in a
wrapper
component...
...and context can be
consumed inside child
components via
useContext(...) hook,
instead of using
Context.Consumer
wrapper
useMemo(...)
useMemo(...) is an alternative
to traditional
shouldcomponentUpdate
lifecycle hook. In this case it
makes sure that <TodoList/>
component re-renders only if
It’s input changes
Rules of Hooks
All hooks should be used at top level
Hook’s can’t be declared conditionally
Use hooks ONLY inside functional components and custom hooks
The order matters
THANK YOU
Contact me
Oleksandr.Oleksiv
@scalac.io
github.com/OleksivO

More Related Content

PPT
The Pillars Of Concurrency
aviade
 
PDF
Minimalist Operating Systems for Containers
Enderson Tadeu Maia
 
PPTX
TRAINING pptt efwoiefo weoifjoiewjfoifjow.pptx
PrathamSharma77833
 
PPTX
react-slidlkjfl;kj;dlkjopidfjhopijgpoerjpofjiwoepifjopweifjepoies.pptx
PrathamSharma77833
 
PDF
Learn react by Etietop Demas
Etietop Demas
 
PPTX
react-slides.pptx
DayNightGaMiNg
 
PPT
EnScript Workshop
Mark Morgan, CCE, EnCE
 
PPTX
Java J2EE Interview Questions Part 2
javatrainingonline
 
The Pillars Of Concurrency
aviade
 
Minimalist Operating Systems for Containers
Enderson Tadeu Maia
 
TRAINING pptt efwoiefo weoifjoiewjfoifjow.pptx
PrathamSharma77833
 
react-slidlkjfl;kj;dlkjopidfjhopijgpoerjpofjiwoepifjopweifjepoies.pptx
PrathamSharma77833
 
Learn react by Etietop Demas
Etietop Demas
 
react-slides.pptx
DayNightGaMiNg
 
EnScript Workshop
Mark Morgan, CCE, EnCE
 
Java J2EE Interview Questions Part 2
javatrainingonline
 

Similar to React Hooks by Oleksandr Oleksiv Scalac (20)

PPTX
Java J2EE Interview Question Part 2
Mindsmapped Consulting
 
KEY
Akka london scala_user_group
Skills Matter
 
PDF
react-slides.pdf gives information about react library
janet736113
 
PDF
react-slides.pdf
DayNightGaMiNg
 
PPTX
OSGi Training for Carbon Developers
Aruna Karunarathna
 
PDF
Effective JavaFX architecture with FxObjects
Srikanth Shenoy
 
PDF
Lezione 03 Introduzione a react
University of Catania
 
PDF
Corso su ReactJS
LinkMe Srl
 
PDF
Intro to Core Data
Make School
 
PPTX
Spring Basics
ThirupathiReddy Vajjala
 
PDF
Signal Framework
Aurora Softworks
 
PPTX
Clojure Fundamentals Course For Beginners
Paddy Lock
 
PPTX
React basics
lakshaya maheshwari
 
PPT
ActionScript 3.0 Fundamentals
Saurabh Narula
 
PDF
Design Patterns in Cocoa Touch
Eliah Nikans
 
ODP
What's new in Java EE 6
Antonio Goncalves
 
PDF
Build Cloud Applications with Akka and Heroku
Salesforce Developers
 
PPT
iPhone development from a Java perspective (Jazoon '09)
Netcetera
 
PDF
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Saeed Zarinfam
 
PPTX
From JSX to Deployment: Mastering the React Workflow for Scalable Front-End D...
sriniravir05
 
Java J2EE Interview Question Part 2
Mindsmapped Consulting
 
Akka london scala_user_group
Skills Matter
 
react-slides.pdf gives information about react library
janet736113
 
react-slides.pdf
DayNightGaMiNg
 
OSGi Training for Carbon Developers
Aruna Karunarathna
 
Effective JavaFX architecture with FxObjects
Srikanth Shenoy
 
Lezione 03 Introduzione a react
University of Catania
 
Corso su ReactJS
LinkMe Srl
 
Intro to Core Data
Make School
 
Signal Framework
Aurora Softworks
 
Clojure Fundamentals Course For Beginners
Paddy Lock
 
React basics
lakshaya maheshwari
 
ActionScript 3.0 Fundamentals
Saurabh Narula
 
Design Patterns in Cocoa Touch
Eliah Nikans
 
What's new in Java EE 6
Antonio Goncalves
 
Build Cloud Applications with Akka and Heroku
Salesforce Developers
 
iPhone development from a Java perspective (Jazoon '09)
Netcetera
 
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Saeed Zarinfam
 
From JSX to Deployment: Mastering the React Workflow for Scalable Front-End D...
sriniravir05
 
Ad

More from Scalac (16)

PDF
Applicative functors by Łukasz Marchewka
Scalac
 
PDF
AWS Api Gateway by Łukasz Marchewka Scalacc
Scalac
 
PDF
Do ECTL not ETL: the art and science of data cleansing in data pipelines by P...
Scalac
 
PDF
Introduction to Scala by Piotr Wiśniowski Scalac
Scalac
 
PDF
ZIO actors by Mateusz Sokół Scalac
Scalac
 
PDF
Why functional programming and category theory strongly matters - Piotr Parad...
Scalac
 
PDF
Big picture of category theory in scala with deep dive into contravariant and...
Scalac
 
PDF
How to write automated tests and don’t lose your mind by Dorian Sarnowski Scalac
Scalac
 
PDF
Do you have that Spark in your ECTL? by Piotr Sych Scalac
Scalac
 
PDF
Can we automate the process of backlog prioritizing? by Adam Gadomski Scalac
Scalac
 
PDF
How to create the right sales funnel for your business? by Maciej Greń
Scalac
 
PDF
ActorRef[Typed] by Andrzej Kopeć
Scalac
 
PPTX
Scala 3camp 2011
Scalac
 
PPTX
Liftweb
Scalac
 
PPTX
Scala == Effective Java
Scalac
 
PPTX
Scala and Lift presentation
Scalac
 
Applicative functors by Łukasz Marchewka
Scalac
 
AWS Api Gateway by Łukasz Marchewka Scalacc
Scalac
 
Do ECTL not ETL: the art and science of data cleansing in data pipelines by P...
Scalac
 
Introduction to Scala by Piotr Wiśniowski Scalac
Scalac
 
ZIO actors by Mateusz Sokół Scalac
Scalac
 
Why functional programming and category theory strongly matters - Piotr Parad...
Scalac
 
Big picture of category theory in scala with deep dive into contravariant and...
Scalac
 
How to write automated tests and don’t lose your mind by Dorian Sarnowski Scalac
Scalac
 
Do you have that Spark in your ECTL? by Piotr Sych Scalac
Scalac
 
Can we automate the process of backlog prioritizing? by Adam Gadomski Scalac
Scalac
 
How to create the right sales funnel for your business? by Maciej Greń
Scalac
 
ActorRef[Typed] by Andrzej Kopeć
Scalac
 
Scala 3camp 2011
Scalac
 
Liftweb
Scalac
 
Scala == Effective Java
Scalac
 
Scala and Lift presentation
Scalac
 
Ad

Recently uploaded (20)

PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
Immersive experiences: what Pharo users do!
ESUG
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PPTX
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
Immersive experiences: what Pharo users do!
ESUG
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Odoo Integration Services by Candidroot Solutions
CandidRoot Solutions Private Limited
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Presentation about variables and constant.pptx
safalsingh810
 

React Hooks by Oleksandr Oleksiv Scalac