The useContext hook is a great hook to use when you need to send props down through multiple, nested child components.
Instead of passing it through every single component on the way down, you can define it in the parent component. Then, bring it into the nested component where you need it, while bypassing the middle components you’d normally have to send it through.
Let’s say you have an App component. Inside that App component, you have a Profile component. Inside the Profile component, you have a Greeting component.
If you’re familiar with the lifecycle methods of class based components (componentDidMount, componentDidUpdate, etc…), the useEffect hook is basically all of those methods rolled up into one convenient function. If you’re not familiar with those lifecycle methods, you’re very lucky 😂 😭.
useEffect is a function that you can configure to run every time a component mounts, unmounts, or only on the initial render. You can reach out to a third party API, or your own backend to retrieve data. It’s very…
The useState hook is the most popular and widely used hook in React. It lets you have state in a functional component. Before the useState hook came out, (React 16.8 🎉), you could only have state in class based components 😭.
Aspiring web developer. Writing about things that I've learned.