Résultat de recherche d'images pour "Hooks React"

Using React Hooks

useState Hook:

useEffect Hook:

componentDidMount:

useEffect(
() => {
console.log("componentDidMount");
},
[]
);

componentDidUpdate:

useEffect(
() => {
console.log("componentDidUpdate => number changes");
},
[number]
);

componentWillUnmout:

useEffect(
() => {
console.log(
"called On mount (componentDidMount) and only number is changed"
);
return () => console.log("--- componentWillUnmount ---");
},
[number]
);

useContext Hook:

Before useContext:

With useContext:

Our own hook:

--

--

Remote Dev | Cofounder & former CTO @ Koober (WE'RE HIRING) | React Native / React / NodeJs Developer — btw Typescript is awesome

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Stan Sarr

Stan Sarr

Remote Dev | Cofounder & former CTO @ Koober (WE'RE HIRING) | React Native / React / NodeJs Developer — btw Typescript is awesome