All React Hooks

in #react3 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.24
TRX 0.21
JST 0.036
BTC 97939.48
ETH 3363.31
USDT 1.00
SBD 3.31