What is it?

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.

Here’s an example

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.

So that’s:


What is useEffect?

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…


What is useState?

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 😭.

How do you use it?

Andrew Gaynor

Aspiring web developer. Writing about things that I've learned.

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