---
title: "Discussion on \"useContext in react: everything you need to know\" | Hashnode"
description: "Discussion on \"useContext in react: everything you need to know\". only understand this: Using useContext is not necessary, we use it to avoid prop drilling.\nHere's how prop drilling works:Let's say the grandfather component has a certain state and the great-grandson component needs to use this state. Now, in order ..."
url: "https://hashnode.com/posts/usecontext-in-react-everything-you-need-to-know/622b7ed16a712aad4c4644c6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [useContext in react: everything you need to know](https://rajatgupta.net/usecontext-in-react-everything-you-need-to-know?utm_source=hashnode&utm_medium=feed)

only understand this: Using useContext is not necessary, we use it to avoid prop drilling. Here's how prop drilling works:Let's say the grandfather component has a certain state and the great-grandson component needs to use this state. Now, in order ...

Mar 11, 2022 · 9 min read · rajatgupta.net  
Updated Jun 17, 2023  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#reacthooks](https://hashnode.com/tag/reacthooks)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Rajat Gupta](https://hashnode.com/@therajatg)

@therajatg · Rajasthan, India

  
[View profile](https://hashnode.com/@therajatg)

I write about CSS, JavaScript, React and everything in between.

Hi, I am rajat. I write about react, javascript or css 4 times a week. One more thing: I would love to work as a frontend engineer (focused on ReactJS). If you have any such role, ping me at dguptarajat@gmail.com.

## Responses 3

Markdown supported · ⌘↵ to post

[Anand Baraik](https://hashnode.com/@anandbaraik)

[Jun 16, 2023](https://hashnode.com/posts/usecontext-in-react-everything-you-need-to-know/622b7ed16a712aad4c4644c6/comment/648c157ee2423ece2c510f9b)

A good read!

[Ruchi Goswami](https://hashnode.com/@RuchiGoswami)

[Mar 27, 2022](https://hashnode.com/posts/usecontext-in-react-everything-you-need-to-know/622b7ed16a712aad4c4644c6/comment/6240991fd31c3ab80f5284e9)

Thank you for writing this!

[Rushikesh Chougule](https://hashnode.com/@rushikesh3299)

[Mar 22, 2022](https://hashnode.com/posts/usecontext-in-react-everything-you-need-to-know/622b7ed16a712aad4c4644c6/comment/6239da025757926c4c2b1eef)

Crisp & well written
