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.28
TRX 0.26
JST 0.039
BTC 94348.92
ETH 3327.25
USDT 1.00
SBD 3.52