SlideShare a Scribd company logo
1 of 77
Download to read offline
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 AsynchrhonouslyDavid 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 SideIgnacio Martín
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab AcademyDreamLab
 
Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Natasha Murashev
 
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 GrailsBurt Beckwith
 
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 GrailsGR8Conf
 
Higher Order Components and Render Props
Higher Order Components and Render PropsHigher Order Components and Render Props
Higher Order Components and Render PropsNitish 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 CompletableFuturesHaim 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 hypeMagdiel Duarte
 
Pragmatic Functional Refactoring with Java 8
Pragmatic Functional Refactoring with Java 8Pragmatic Functional Refactoring with Java 8
Pragmatic Functional Refactoring with Java 8Codemotion
 
(국비지원학원/재직자교육/실업자교육/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 .pdfnishant078cs23
 
react-hooks.pdf
react-hooks.pdfreact-hooks.pdf
react-hooks.pdfchengbo 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 HooksSoluto
 
Recompacting your react application
Recompacting your react applicationRecompacting your react application
Recompacting your react applicationGreg Bergé
 
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 2019Codemotion
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projectsIgnacio 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
 
[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 IntroductionVisual Engineering
 
[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 FrameworkOdoo
 
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 componentYao 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

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

How do we use hooks