All React Hooks

in #react4 years ago (edited)

Let's try to study all react hooks you gonna face

icon.png

useState

re-render is the key when things change. You can not change the value directly so have to use it with the function(setSth) in useState to mutate.

carbon.png

useReducer

function reducer() {
    return {...} // return a new state while keeping immutability 
}

carbon.png

reference
https://reactjs.org/docs/hooks-intro.html

Coin Marketplace

STEEM 0.12
TRX 0.34
JST 0.032
BTC 112236.99
ETH 4141.74
USDT 1.00
SBD 0.85