useContext Hook: Simplifying Data Sharing in React with Context API - part 21

  Рет қаралды 302

Elpeeda

Elpeeda

Күн бұрын

In this tutorial, we dive into the powerful Context API introduced by React, allowing you to easily share data or state between components, regardless of their position in the component tree.
explore how to utilize the useContext hook and I'll take you through the process of building a Localization project, where you'll discover the power of the context API in eliminating props drilling issues.
#reactjs #contextAPI #usecontext
---------------------------------------------------------------------------------
Composition Pattern - • Nested Component And C...
------------------------------------------------------------------------------------
blog - www.elpeeda.net/
I also write an article in detail please visit If you enjoy reading more.
Link - www.elpeeda.net/2023/05/react...
-------------------------------------------------------------------------------------------
Timestamps -
00:00 - intro
0:39 - useContext hook and props drilling
2:59 - Localization react js project
3:51 - Creating Context
5:25 - Setting up Provider
7:55 - useContext for consuming context
10:13 - Debugging code
10:41 - Outputting
11:33 - Handle Global State
15:53 - outro
---------------------------------------------------------------------------------------
Pinterest: / _created
Instagram: / elpeedanet
---------------------------------------------------------------------------------
Tags:
- ReactJS Tutorial
- ReactJS Tutorial for Beginners
- context api react
- reactjs project
I'd appreciate it if you would subscribe and click the bell button.
Follow me on social media

Пікірлер: 4
@dhruvjoshi6114
@dhruvjoshi6114 Жыл бұрын
Thank you so much for the latest referance about react hooks. I was applied old syntaxt and confused.
@elpeedanet
@elpeedanet Жыл бұрын
Thank you for your input! I'm glad that was useful to you in some manner.
@deepmane5845
@deepmane5845 10 ай бұрын
if i want to use other data so for that i have to create one more context and wrap it around App so if i do this many times for different data then it is more complicated ? what do you say ?
@elpeedanet
@elpeedanet 10 ай бұрын
You're right, it can become complex and hard to manage. In this case you can encapsulate all of context providers into single file and only wrap your top-level component with one context provider or you can use redux.
Mastering React Context: Do you NEED a state manager?
37:26
Jack Herrington
Рет қаралды 97 М.
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 15 МЛН
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 78 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 2 МЛН
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 472 М.
Making React Context FAST!
33:34
Jack Herrington
Рет қаралды 86 М.
Learn React Hooks: useContext - Simply Explained!
15:46
Cosden Solutions
Рет қаралды 139 М.
Enums considered harmful
9:23
Matt Pocock
Рет қаралды 198 М.
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 15 МЛН