---
title: "Discussion on \"useContext() - React Hooks\" | Hashnode"
description: "Discussion on \"useContext() - React Hooks\". 1. Set Up the Context\ncreate a file called ThemeContext.js and add the below code\n// 📂 context/ThemeContext.js\nimport React, { useState, createContext } from \"react\";\n\n// Create context object\n// const ThemeContext = React.createContext();\nconst The..."
url: "https://hashnode.com/posts/usecontext-react-hooks/66a371680f388fcde5fafa10"
---

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

Discussion

# [useContext() - React Hooks](https://namaste-react.hashnode.dev/usecontext-react-hooks?utm_source=hashnode&utm_medium=feed)

1\. Set Up the Context create a file called ThemeContext.js and add the below code // 📂 context/ThemeContext.js import React, { useState, createContext } from "react"; // Create context object // const ThemeContext = React.createContext(); const The...

Jul 26, 2024 · 2 min read · namaste-react.hashnode.dev  
Updated Aug 1, 2024  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#usecontext-hook](https://hashnode.com/tag/usecontext-hook)
-   [#usecontext](https://hashnode.com/tag/usecontext)

## Written by

[Ayush Kumar](https://hashnode.com/@krayush1109)

@krayush1109 · Bhopal

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

MERN Stack Developer

A passionate MERN Stack Developer from India I am a full stack web developer with experience in building responsive websites and applications using JavaScript frameworks like ReactJS, NodeJs, Express etc.,

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
