SlideShare a Scribd company logo
PREACT HOOKS
HOW DO WE USE HOOKS
Junmin Liu
PART I
▸ Why do we need hooks
▸ What are hooks
PART II
▸ How do we use hooks
▸ When should you use or not use
hooks?
WHY DO WE NEED HOOKS?
Alex Chen
TEXT
HISTORICAL
CONTEXT
BEFORE REACT
+
DATA TEMPLATE
HTML
REACT/PREACT
HTML
JSX/HYPERTEXT
RE-RENDER
STATE
COMPONENT
INITIALIZATION
MOUTING
UPDATING
UNMUTING
Lifecycle
STATE MANAGEMENT
REDUX
STORE
PROBLEMS
HOW TO SHARE LOGIC
BETWEEN COMPONENTS?
Tony Lee
TEXT
REUSING LOGIC
HIGHER-ORDER COMPONENTS
▸ A function that takes a component
and returns a new component
▸ e.g. React-Redux’s connect function
<ComponentWhichImplementsLogic>
<ComponentWhichUsesLogic />
<ComponentWhichImplementsLogic>
ComponentWhichImplementsLogic(
ComponentWhichUsesLogic
)
withMousePosition(withClock(MyComponent))
withClock(MyComponent)
REUSING LOGIC
RENDER PROPS
▸ Using a prop whose value is a
function.
▸
<Clock
render={props => <MyComponent {...props} />}
/>
<Clock render={({time}) => (
<MousePosition render={({x, y}) => (
<MyComponent time={time} x={x} y={y} />
)} />
)} />
WRAPPER
HELL
GIANT COMPONENTS
Sophie Alpert
TEXT
GIANT COMPONENTS
▸ The logic is split across a lot of different lifecycle methods
▸ Duplicate code for different lifecycle methods
▸ Thousands of lines code
export default class Responsive extends Component {
constructor(props) {
super(props);
this.state = {};
this.syncState = this.syncState.bind(this);
}
syncState() {
const windowDimensions = Dimensions.get('window');
const screenDimensions = Dimensions.get('screen');
this.setState({
windowWidth: windowDimensions.width, windowHeight: windowDimensions.height,
screenWidth: screenDimensions.width, screenHeight: screenDimensions.height,
});
}
componentDidMount() {
this.syncState();
Dimensions.addEventListener('change', this.syncState);
}
componentWillUnmount() {
Dimensions.removeEventListener('change', this.syncState);
}
render() {
const renderChildren = this.props.children;
return renderChildren(this.state);
}
}
SHOULD I USE CLASS
COMPONENT OR FUNCTION
COMPONENT?
Rajalakshmi Somasundaram
TEXT
CONFUSING CLASSES
▸ Use class component to access state and life cycles
▸ Have to convert your function component to class
component if you add some state (Why not use class
component by default)
▸ Don’t forget `bind(this)` 😄
WHAT’S REACT HOOKS?
Agustin Quiroga
TEXT
Functions which can only be used from inside
Functional Components or Other Hooks
Named useXXX()
Use state, life cycles and other features
without writing a class
Hooks are highly re-usable
and independent for each component
HOOKS EXAMPLE
NO WRAPPER HELL
const MyComponent = () => {
const [time] = useClock();
const [x, y] = useMouseMove();
// do something with those values
return (
<>
<div>Current time: {time}</div>
<div>Mouse coordinates: {x},{y}</div>
</>
);
}
<Clock render={({time}) => (
<MousePosition render={({x, y}) => (
<MyComponent time={time} x={x} y={y} />
)} />
)} />
withMousePosition(withClock(MyComponent))
RENDER PROPS
HOC HOOKS
HOOKS EXAMPLE
NO GIANT COMPONENT
class FriendStatus extends React.Component {
constructor(props) {
super(props);
this.state = { isOnline: null };
this.handleStatusChange =
this.handleStatusChange.bind(this);
}
componentDidMount() {
ChatAPI.subscribeToFriendStatus(
this.props.friend.id,
this.handleStatusChange
);
}
componentWillUnmount() {
ChatAPI.unsubscribeFromFriendStatus(
this.props.friend.id,
this.handleStatusChange
);
}
handleStatusChange(status) {
this.setState({
isOnline: status.isOnline
});
}
render() {
if (this.state.isOnline === null) {
return 'Loading...';
}
return this.state.isOnline ? 'Online' : 'Offline';
}
}
function FriendStatus(props) {
const [isOnline, setIsOnline] = useState(null);
useEffect(() => {
function handleStatusChange(status) {
setIsOnline(status.isOnline);
}
ChatAPI.subscribeToFriendStatus(props.friend.id, handleStatusChange);
// Specify how to clean up after this effect:
return function cleanup() {
ChatAPI.unsubscribeFromFriendStatus(props.friend.id, handleStatusChange);
};
});
if (isOnline === null) {
return 'Loading...';
}
return isOnline ? 'Online' : 'Offline';
}
APIS ARE FREQUENTLY USED
▸ useState
▸ useEffect
▸ useContext
▸ useMemo / useCallback
▸ useRef
▸ useReducer
useState
▸ Manage states in your functional components
import { h, useState } from 'preact/hooks';
function Example() {
// Declare a new state variable, which we'll call "count"
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
useEffect
▸ componentDidMount + componentDidUpdate + componentWillUnmount
useEffect(() => {
function handleStatusChange(status) {
setIsOnline(status.isOnline);
}
ChatAPI.subscribeToFriendStatus(props.friend.id,
handleStatusChange);
return () => {
ChatAPI.unsubscribeFromFriendStatus(props.friend.id,
handleStatusChange);
};
}, [props.friend.id]); // Only re-subscribe if
props.friend.id changes
componentDidMount() {
ChatAPI.subscribeToFriendStatus(
this.props.friend.id,
this.handleStatusChange
);
}
componentDidUpdate(prevProps) {
// Unsubscribe from the previous friend.id
ChatAPI.unsubscribeFromFriendStatus(
prevProps.friend.id,
this.handleStatusChange
);
// Subscribe to the next friend.id
ChatAPI.subscribeToFriendStatus(
this.props.friend.id,
this.handleStatusChange
);
}
componentWillUnmount() {
ChatAPI.unsubscribeFromFriendStatus(
this.props.friend.id,
this.handleStatusChange
);
}
useContext
▸ Return React.createContext as a value, no more “Wrapper Hell”
const ThemeContext = createContext(themes.light);
function App() {
return (
<ThemeContext.Provider value={themes.dark}>
<Toolbar />
</ThemeContext.Provider>
);
}
function Toolbar(props) {
return (<div><ThemedButton /></div>);
}
function ThemedButton() {
const theme = useContext(ThemeContext);
return (
<button style={{ background: theme.background, color: theme.foreground }}>
I am styled by theme context!
</button>
);
}
useMemo
▸ Cache expensive calculations to make the render faster
▸ Similar to reselect for redux
▸ Fuzzy Highlighter Example
export default function FuzzyHighlighter(props) {
const { query, children, color, style } = props;
function highlight(text, query) {
// calculate highlight text
}
const highlightedResult = useMemo(
() => highlight(children, query),
[query, children]
);
return (
<Text color={color} style={style}>
{highlightedResult}
</Text>
);
}
CACHE DEPENDENCY
RESULT CACHED
useCallback
▸ useCallback(fn, deps) is equivalent to useMemo(() => fn, deps).
const memoizedCallback = useCallback(
() => {
doSomething(a, b);
},
[a, b],
);
useRef
▸ useRef returns a mutable ref object. The returned object will persist for
the full lifetime of the component.
function TextInputWithFocusButton() {
const inputEl = useRef(null);
const onButtonClick = () => {
// `current` points to the mounted text
input element
inputEl.current.focus();
};
return (
<>
<input ref={inputEl} type="text" />
<button onClick={onButtonClick}>Focus the
input</button>
</>
);
}
class TextInputWithFocusButton extends Component {
constructor(props) {
super(props);
this.inputEl = null;
this.handleButtonClick =
this.handleButtonClick.bind(this);
this.handleRef = this.handleRef.bind(this);
}
handleButtonClick() {
this.inputEl.focus();
}
handleRef(elm) {
this.inputEl = elm;
}
return (
<>
<input ref={handleRef} type="text" />
<button onClick={this.handleButtonClick}>Focus</
button>
</>
);
}
useState
useMemo
useCallback
useRef
DATA HOOKS MEMOIZE HOOKS
useReducer
▸ useReducer + Context API = redux
▸ when you have complex state logic that involves multiple sub-values
or when the next state depends on the previous one.
▸ 《Use Hooks + Context, not React + Redux》
Q & A
Junmin Liu
PART I
HOW DO YOU USE HOOKS?
Yizhi Zhou
TEXT
useHash()
Example 1
TEXT
REQUIREMENT
▸ Show the dialog if the url hash is
#do-not-sell
▸ Hide the dialog if the urls hash is
not #do-not-sell
IMPLEMENT IT WITH CLASS COMPONENT
import React, { Component } from 'react';
export class DoNotSell extends Component {
constructor(props) {
super(props);
this.state = {
hash: window.location.hash
}
this.handleHashChange =
this.handleHashChange.bind(this);
}
componentDidMount() {
window.addEventListener('hashchange',
this.handleHashChange);
}
componentWillUnmount() {
window.removeEventListener('hashchange',
this.handleHashChange);
}
handleHashChange() {
this.setState({
hash: window.location.hash
})
}
handleClose() {
window.location.hash = '';
}
render() {
const open = this.state.hash === '#do-not-sell'
return (
<Dialog
open={open}
onClose={this.handleClose}
>
...
</Dialog>
);
}
}
TEXT
LOOKS GOOD SO FAR, BUT …
▸ It’s hard to reuse the logic
▸ Mix the logic with UI together
LET’S TRY CUSTOM HOOKS
Junmin Liu
TEXT
IMPLEMENT IT WITH HOOKS
export default function useHash(initialValue = null) {
// init state with current hash value
const [hash, setHash] = useState(window.location.hash);
// change the url hash
const setHashValue = value => {
window.location.hash = value ? `#${value}` : '';
};
useEffect(() => {
function handleHashChange() {
// update state value with current hash
setHash(window.location.hash);
}
window.addEventListener('hashchange', handleHashChange);
return function cleanup() {
window.removeEventListener('hashchange', handleHashChange);
};
});
return [hash, setHashValue];
}
export function DoNotSell() {
const [hash, setHash] = useHash();
const open = hash === '#do-not-sell'
return (
<Dialog
open={open}
onClose={() => setHash('')}
>
...
</Dialog>
);
}
TEXT
BENEFITS WE GOT
▸ Reuse the logic easily:
▸ lib/hooks/useHash
▸ Separate the UI and business logic
useSuggestions
Example2
TEXT
REQUIREMENT
▸ Type keyword
▸ Show autocomplete suggestions
I’M A BIG FAN OF REDUX!
I LOVE REDUX DEV TOOL!
Raji
TEXT
STORE
REDUCERS
ACTIONS API
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
STORE
REDUCERS
ACTIONS API
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
EVENT
onInput
STORE
REDUCERS
ACTIONS API
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
REQ
A
{
type: 'SUGGESTS_REQUEST',
query: 'piz'
}
LOADING…
STORE
REDUCERS
ACTIONS LOADING…
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
S
A
{
search: { query: '' },
suggestions: {}
}
STORE
REDUCERS
ACTIONS LOADING…
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
S A
{
search: { query: '' },
suggestions: {}
}
{
type: 'SUGGESTS_REQUEST',
query: 'piz'
}
{
search: { query: 'piz' },
suggestions: {}
}
STORE
REDUCERS
ACTIONS LOADING…
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
S A
{
search: { query: 'piz' },
suggestions: {
'piz': {
loading: true,
items: []
}
}
}
STORE
REDUCERS
ACTIONS LOADING…
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
SUB
STORE
REDUCERS
ACTIONS LOADING…
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
S A
STORE
REDUCERS
ACTIONS API
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
RES
A
{
type: 'SUGGESTS_SUCCESS',
query: 'piz',
items: [
'pizza',
'jets pizza',
'nicks pizza'
]
}
STORE
REDUCERS
ACTIONS API
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
S
A
{
search: { query: 'piz' },
suggestions: {
'piz': {
loading: true,
items: []
}
}
}
STORE
REDUCERS
ACTIONS API
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
S A
{
search: { query: 'piz' },
suggestions: {
'piz': {
loading: false,
items: [
'pizza',
'jets pizza',
'nicks pizza'
]
}
}
}
STORE
REDUCERS
ACTIONS API
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
{
search: { query: 'piz' },
suggestions: {
'piz': {
loading: false,
items: [
'pizza',
'jets pizza',
'nicks pizza'
]
}
}
}
S A
STORE
REDUCERS
ACTIONS API
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
SUB
STORE
REDUCERS
ACTIONS API
VIEWSINPUT
SUGGESTIONS
LIST
STATE
DISPATCHER
MIDDLEWARES
searchReducer
suggestionsReducer
SUGGESTIONS
LIST
STATE
SUGGESTIONS
LIST
STATE
search suggestions
{
query: 'piz'
}
{
piz: {
loading: false,
items: [
'pizza',
'jets pizza',
'nicks pizza'
]
}
}
props
{
loading: false,
items: [
'pizza',
'jets pizza',
'nicks pizza'
]
}
WHY DO WE NEED REDUX FOR
SUGGESTIONS?
Yizhi Zhou
TEXT
TEXT
WHY DO WE NEED REDUX?
▸ Communication between
components
▸ e.g. Input ->
SuggestionsList
▸ Dealing with async
▸ e.g. Ajax call
▸ Redux Dev Tool
COULD WE GET RIDE OF
REDUX FOR SUGGETIONS?
Tony Lee
TEXT
TEXT
COMMUNICATION BETWEEN COMPONENTS
▸ Share a same parent component
▸ Using React Context
SUGGESTIONS
INPUT
SUGGESTIONS
LIST
TEXT
DEALING WITH ASYNC
▸ We can’t use async/await in a render function. 😢
let loading = false;
const suggestions = await fetchSuggestions(query);
loading = false;
TEXT
DEALING WITH ASYNC
▸ But we can use custom hooks. 😄
const [query, setQuery] = useState('');
const {loading, suggestions} = useSuggestions(query);
if (loading) {
return 'loading...'
}
return (
<ul>
{suggestions.map(renderSuggstion)}
</ul>
)
DEMO WITH CODESANDEBOX
Junmin Liu
TEXT
https://codesandbox.io/s/priceless-paper-hde2b
render
Functional component
useState
useSuggestions(query)
INPUT
SUGGESTIONS
LIST
query: “preact”
useSuggestions(query)
loadingMap: {}useState
useState suggestionsMap: {}
useEffect(() => {}, [query])
FETCH
loading: false,
suggestions: []
loading: false,
suggestions: []
render
Functional component
useState
useSuggestions(query)
INPUT
SUGGESTIONS
LIST
query: “preact”
useSuggestions(query)
loadingMap: {}useState
useState suggestionsMap: {}
useEffect(() => {}, [query])
FETCH
loading: true,
suggestions: []
API
loadingMap: {
preact: true
}
loading: true,
suggestions: []
render
Functional component
useState
useSuggestions(query)
INPUT
SUGGESTIONS
LIST
query: “preact”
useSuggestions(query)
useState
useState suggestionsMap: {}
useEffect(() => {}, [query])
FETCH
loading: false,
suggestions: […]
API
loadingMap: {
preact: true
}
loadingMap: {
preact: false
}
suggestionsMap: {
preact: […]
}loading: false,
suggestions: […]
render
Functional component
useState
useSuggestions(query)
INPUT
SUGGESTIONS
LIST
query: “preact”
useSuggestions(query)
loadingMap: {}useState
useState
suggestionsMap: {
preact: […]
}
useEffect(() => {}, [query])
FETCH
loading: false,
suggestions: []
API
loadingMap: {
preact: false
}
loading: false,
suggestions: []
query: “react”
render
Functional component
useState
useSuggestions(query)
INPUT
SUGGESTIONS
LIST
query: “react”
useSuggestions(query)
loadingMap: {
preact: true
}
useState
useState
suggestionsMap: {
preact: […]
}
useEffect(() => {}, [query])
FETCH
loading: true,
suggestions: []
API
loadingMap: {
preact: false,
react: true
}
loading: true,
suggestions: []
render
Functional component
useState
useSuggestions(query)
INPUT
SUGGESTIONS
LIST
query: “react”
useSuggestions(query)
useState
useState
suggestionsMap: {
preact: […]
}
useEffect(() => {}, [query])
FETCH
loading: false,
suggestions: […]
API
loadingMap: {
preact: false,
react: true
}
loadingMap: {
preact: false,
react: false
}
suggestionsMap: {
preact: […],
react: […]
}loading: false,
suggestions: […]
WHEN SHOULD YOU USE OR
NOT USE HOOKS?
Raji
TEXT
HOOKS VS REDUX
HOOKS
▸ Light
▸ New APIs for function
components
▸ useReducer + Context works
like redux
▸ React Dev Tool
REDUX
▸ Powerful
▸ State management
framework
▸ React-Redux has hooks API,
useSelector, useDispatch
▸ Redux Dev Tool
COMPONENT APP
HOOKS REDUX
HOOKS
+
CONTEXT
REDUX
Q & A
Junmin Liu
TEXT

More Related Content

What's hot

Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results Asynchrhonously
David Gómez García
 
Extending Redux in the Server Side
Extending Redux in the Server SideExtending Redux in the Server Side
Extending Redux in the Server Side
Ignacio Martín
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab Academy
DreamLab
 
Utilizing Bluebird Promises
Utilizing Bluebird PromisesUtilizing Bluebird Promises
Utilizing Bluebird Promises
Nicholas van de Walle
 
Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)
Natasha Murashev
 
Completable future
Completable futureCompletable future
Completable future
Srinivasan Raghvan
 
Under the Hood: Using Spring in Grails
Under the Hood: Using Spring in GrailsUnder the Hood: Using Spring in Grails
Under the Hood: Using Spring in Grails
Burt Beckwith
 
Firebase ng2 zurich
Firebase ng2 zurichFirebase ng2 zurich
Firebase ng2 zurich
Christoffer Noring
 
Under the Hood: Using Spring in Grails
Under the Hood: Using Spring in GrailsUnder the Hood: Using Spring in Grails
Under the Hood: Using Spring in Grails
GR8Conf
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
Christoffer Noring
 
Saving lives with rx java
Saving lives with rx javaSaving lives with rx java
Saving lives with rx java
Shahar Barsheshet
 
Higher Order Components and Render Props
Higher Order Components and Render PropsHigher Order Components and Render Props
Higher Order Components and Render Props
Nitish Phanse
 
The Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFuturesThe Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFutures
Haim Yadid
 
Converting Db Schema Into Uml Classes
Converting Db Schema Into Uml ClassesConverting Db Schema Into Uml Classes
Converting Db Schema Into Uml ClassesKaniska Mandal
 
React hooks beyond hype
React hooks beyond hypeReact hooks beyond hype
React hooks beyond hype
Magdiel Duarte
 
Pragmatic Functional Refactoring with Java 8
Pragmatic Functional Refactoring with Java 8Pragmatic Functional Refactoring with Java 8
Pragmatic Functional Refactoring with Java 8
Codemotion
 
(국비지원학원/재직자교육/실업자교육/IT실무교육_탑크리에듀)#4.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)
(국비지원학원/재직자교육/실업자교육/IT실무교육_탑크리에듀)#4.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)(국비지원학원/재직자교육/실업자교육/IT실무교육_탑크리에듀)#4.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)
(국비지원학원/재직자교육/실업자교육/IT실무교육_탑크리에듀)#4.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)
탑크리에듀(구로디지털단지역3번출구 2분거리)
 

What's hot (20)

Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results Asynchrhonously
 
Extending Redux in the Server Side
Extending Redux in the Server SideExtending Redux in the Server Side
Extending Redux in the Server Side
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab Academy
 
Utilizing Bluebird Promises
Utilizing Bluebird PromisesUtilizing Bluebird Promises
Utilizing Bluebird Promises
 
Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)
 
Swing
SwingSwing
Swing
 
Completable future
Completable futureCompletable future
Completable future
 
Under the Hood: Using Spring in Grails
Under the Hood: Using Spring in GrailsUnder the Hood: Using Spring in Grails
Under the Hood: Using Spring in Grails
 
Firebase ng2 zurich
Firebase ng2 zurichFirebase ng2 zurich
Firebase ng2 zurich
 
Under the Hood: Using Spring in Grails
Under the Hood: Using Spring in GrailsUnder the Hood: Using Spring in Grails
Under the Hood: Using Spring in Grails
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
 
Saving lives with rx java
Saving lives with rx javaSaving lives with rx java
Saving lives with rx java
 
Higher Order Components and Render Props
Higher Order Components and Render PropsHigher Order Components and Render Props
Higher Order Components and Render Props
 
AutoComplete
AutoCompleteAutoComplete
AutoComplete
 
The Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFuturesThe Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFutures
 
Converting Db Schema Into Uml Classes
Converting Db Schema Into Uml ClassesConverting Db Schema Into Uml Classes
Converting Db Schema Into Uml Classes
 
Final_Project
Final_ProjectFinal_Project
Final_Project
 
React hooks beyond hype
React hooks beyond hypeReact hooks beyond hype
React hooks beyond hype
 
Pragmatic Functional Refactoring with Java 8
Pragmatic Functional Refactoring with Java 8Pragmatic Functional Refactoring with Java 8
Pragmatic Functional Refactoring with Java 8
 
(국비지원학원/재직자교육/실업자교육/IT실무교육_탑크리에듀)#4.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)
(국비지원학원/재직자교육/실업자교육/IT실무교육_탑크리에듀)#4.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)(국비지원학원/재직자교육/실업자교육/IT실무교육_탑크리에듀)#4.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)
(국비지원학원/재직자교육/실업자교육/IT실무교육_탑크리에듀)#4.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)
 

Similar to How do we use hooks

React JS Hooks Sheet .pdf
React JS Hooks Sheet .pdfReact JS Hooks Sheet .pdf
React JS Hooks Sheet .pdf
nishant078cs23
 
react-hooks.pdf
react-hooks.pdfreact-hooks.pdf
react-hooks.pdf
chengbo xu
 
React new features and intro to Hooks
React new features and intro to HooksReact new features and intro to Hooks
React new features and intro to Hooks
Soluto
 
Recompacting your react application
Recompacting your react applicationRecompacting your react application
Recompacting your react application
Greg Bergé
 
React hooks
React hooksReact hooks
React hooks
Assaf Gannon
 
Road to react hooks
Road to react hooksRoad to react hooks
Road to react hooks
Younes (omar) Meliani
 
React redux
React reduxReact redux
React redux
Michel Perez
 
React outbox
React outboxReact outbox
React outbox
Angela Lehru
 
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Codemotion
 
ReactJS
ReactJSReactJS
ReactJS
Kamlesh Singh
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projects
Ignacio Martín
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
Varun Raj
 
React 101
React 101React 101
React 101
Casear Chu
 
[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법
Jeado Ko
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS Introduction
Visual Engineering
 
Introduction to Redux
Introduction to ReduxIntroduction to Redux
Introduction to Redux
Ignacio Martín
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation洪 鹏发
 
Owl: The New Odoo UI Framework
Owl: The New Odoo UI FrameworkOwl: The New Odoo UI Framework
Owl: The New Odoo UI Framework
Odoo
 
Reactивная тяга
Reactивная тягаReactивная тяга
Reactивная тяга
Vitebsk Miniq
 
Enhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order componentEnhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order component
Yao Nien Chung
 

Similar to How do we use hooks (20)

React JS Hooks Sheet .pdf
React JS Hooks Sheet .pdfReact JS Hooks Sheet .pdf
React JS Hooks Sheet .pdf
 
react-hooks.pdf
react-hooks.pdfreact-hooks.pdf
react-hooks.pdf
 
React new features and intro to Hooks
React new features and intro to HooksReact new features and intro to Hooks
React new features and intro to Hooks
 
Recompacting your react application
Recompacting your react applicationRecompacting your react application
Recompacting your react application
 
React hooks
React hooksReact hooks
React hooks
 
Road to react hooks
Road to react hooksRoad to react hooks
Road to react hooks
 
React redux
React reduxReact redux
React redux
 
React outbox
React outboxReact outbox
React outbox
 
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
 
ReactJS
ReactJSReactJS
ReactJS
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projects
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
React 101
React 101React 101
React 101
 
[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS Introduction
 
Introduction to Redux
Introduction to ReduxIntroduction to Redux
Introduction to Redux
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
Owl: The New Odoo UI Framework
Owl: The New Odoo UI FrameworkOwl: The New Odoo UI Framework
Owl: The New Odoo UI Framework
 
Reactивная тяга
Reactивная тягаReactивная тяга
Reactивная тяга
 
Enhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order componentEnhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order component
 

Recently uploaded

Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
vrstrong314
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 

Recently uploaded (20)

Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 

How do we use hooks