Context API in React JS in Hindi in 2020 #51

Поділитися
Вставка
  • Опубліковано 25 сер 2024
  • React Context API is a way to essentially create global variables that can be passed around in a React app. This is the alternative to "prop drilling", or passing props from grandparent to parent to child, and so on. Context is often touted as a simpler, lighter solution to using Redux for state management.
    In a typical React application, data is passed top-down (parent to child) via props, but this can be cumbersome for certain types of props (e.g. locale preference, UI theme) that are required by many components within an application. Context provides a way to share values like these between components without having to explicitly pass a prop through every level of the tree.
    ************ Must Watch Videos For Web Development ************
    ➡️ Hooks in React JS in Hindi | useState in Hook in React JS: • #30: Hooks in React J...
    ➡️ React DevTools & Source Code Link: www.thapatechn...
    ➡️ ReactJS Tutorial in Hindi 2020 Playlist Link: • React JS Tutorial in H...
    ➡️ ReactJS JavaScript Array Map Method in Hindi with Example: • ReactJS JavaScript Arr...
    ➡️ Fat Arrow Function in JavaScript in Hindi 2020: • ES6 Tutorial #8: Fat A...
    ➡️ #22: React JS Project Netflix App Part #1 in Hindi in 2020: • #22: Props in React Js...

    ➡️ Install VS Code for ReactJS LINK: www.thapatechn...
    ➡️ Check Complete Reactjs in One video here 👇 • ReactJS For Beginners ...
    ➡️ HTML in One Video: • Learn HTML in One Vide...
    ➡️ CSS in One video: • Learn Complete CSS In ...
    ➡️ CSS FlexBox in 30 Minutes: • CSS FlexBox in 30 Minu...
    ➡️ JavaScript in One video: • JavaScript in One Vide...
    ➡️ ECMAScript 6 in One Video: • ES5 & ES6 | ECMAScript...
    ➡️ HTML5 in one video: • HTML5 Tutorial in One ...
    ➡️ CSS3 in one video: • Learn Complete CSS3 In...
    ➡️ Bootstrap4 in One video: • Bootstrap 4 in One Vid...
    ➡️ Jquery in One video: • jQuery in One Video in...
    ➡️ JSON in one video: • JSON in One Video in H...
    ➡️ ReactJS in one video: • ReactJS For Beginners ...
    ➡️ PHP in One Video: • PHP TUTORIAL IN ONE VI...
    ➡️ NodeJS in one video: / ipnwakoibt
    ➡️ MySQL in one video: • Complete SQL & MySQL i...
    ********** CLICK HERE TO WATCH ************
    ➡️ Fetch API in JavaScript: • Fetch API in JavaScrip...
    ➡️ AJAX tutorial for beginners in Hindi: • AJAX tutorial for begi...
    ➡️ Template literals (Template strings) in ES6 in JavaScript in Hindi: • ES6 Tutorial #3: Templ...
    ➡️ Async Await in JavaScript in Hindi: • Async Await in JavaScr...
    ➡️ Promises in JavaScript in Hindi: • Master The Promises in...
    ➡️ Callback Hell in JavaScript: • Callback Hell in JavaS...
    ➡️ Advanced JavaScript in Hindi Playlist: • Advanced JavaScript Tu...
    ➡️ ECMAScript Tutorial in Hindi 2020: • Modern JavaScript ES6 ...
    ➡️ ES5 & ES6 | ECMAScript 6 in One Video in Hindi: • ES5 & ES6 | ECMAScript...
    ➡️ JavaScript Game Development Series in 2020: • JavaScript Game Develo...
    ➡️ Source Code Link: www.thapatechn...
    ➡️ Top 5 Programming Languages in 2020: • Top 5 Programming Lang...
    ➡️ Ludo Game JavaScript Link: • JavaScript Game in Hin...
    ➡️Plz show some love to My Siter UA-cam Channel and Plz Subscribe Link: / @mayabeautyvlogs878
    **************** MUST WATCH VIDEOS *****************
    ➡️ How to become a Full Stack Developer 2020: • How to become a Full S...
    ➡️ How To Become a Web Developer 2020: • How To Become a Web De...
    ➡️ How JavaScript Works: • How JavaScript Works i...
    ➡️ Follow me on Instagram: / vinodthapa55
    Make Website Responsive Using Media Queries in One Video in Hindi | Web Design Tutorial in Hindi
    ➡️ Link: • Make Website Responsiv...
    Guys, Please support my channel by SUBSCRIBE to my channel and share my videos in your Social Network TimeLines.
    Don't Forget to Follow me on all Social Network,
    Website Link: www.thapatechn...
    Instagram Link: / vinodthapa55
    Facebook Link: / vinodthapa55
    Twitter Link: / vb55thapa
    Facebook ThapaTechnical Page Link: www.facebook.c...

КОМЕНТАРІ • 222

  • @ThapaTechnical
    @ThapaTechnical  4 роки тому +54

    Guys, Finally video after 2 long days :) everything is fine now... Hope you like the video :)

    • @tarunjoshi1106
      @tarunjoshi1106 4 роки тому

      Sir COVID 19 india ke api ka use krke React Js mai bhi bnao 👌☺️
      Jo data ko display kre properly 😋👌

    • @tarunjoshi1106
      @tarunjoshi1106 4 роки тому

      🤣🤣🤣 wtf I was doing 2 months ago.

    • @letsknowthis1862
      @letsknowthis1862 3 роки тому +1

      hii vinod your doing very good job we are fallowing your tutorial but it is not good to ask money in the middle of the cousre for code you can do live coding we will super chat you..hope you understand

    • @mananbari4725
      @mananbari4725 3 роки тому

      @Thapa%Technical Can you please make a video for Global state Context and Hooks

    • @sallbro4134
      @sallbro4134 3 роки тому

      const Firstname= useContext ();
      when I am exporting Firstname
      Showing:-
      Export 'Firstname' is not defined

  • @ayyasudeen3118
    @ayyasudeen3118 3 роки тому +46

    Bhai, I am a Tamil. My Hindi is average but I am able to understand your tutorials very well. You are an amazing teacher! Thank you very much!

    • @entertainmentcreations7661
      @entertainmentcreations7661 Рік тому +2

      You need to learn Hindi bro

    • @raviiirathore9984
      @raviiirathore9984 Рік тому +1

      ​@@entertainmentcreations7661
      Why he should learn Hindi ?

    • @pradattaaryal3523
      @pradattaaryal3523 8 місяців тому

      @@raviiirathore9984vinod is from nepal pokhara

    • @luffydono0
      @luffydono0 3 місяці тому

      @@raviiirathore9984 bcz i am in karnataka they are forcing me to learn kannada so he need to learn HINDI.

  • @islamicbeautifulvibes454
    @islamicbeautifulvibes454 8 місяців тому +2

    your method is very amazing thank you so much dill kya aj comment krny ko you are best teacher Allah apko hmsha slamat rkhy FROM PAKISTAN

  • @tejendrarajawat4054
    @tejendrarajawat4054 2 роки тому +12

    Your lectures are very underrated 👍

  • @sugandhasharma5484
    @sugandhasharma5484 3 роки тому +2

    Excellent!!! bade bade Technical youtubers fail hain aapke saamne Sir.

  • @Uk_mandiii
    @Uk_mandiii 3 роки тому +1

    Kamal ka technical methode bro learn only in this video context api

  • @soniapadhi7471
    @soniapadhi7471 Місяць тому

    You are an amazing teacher! Thank you very much!

  • @aniketmasram6500
    @aniketmasram6500 2 роки тому +1

    Thank you soo much bhaiya, you are the real provider ❤️🙏🏻

  • @fayeazahmedrhythm7460
    @fayeazahmedrhythm7460 4 роки тому +4

    Vai, amazing. I just got to context api two days ago, watched some videos, and was confused. A lot of things got cleared after watching this video, waiting eagerly for the video on useContext. Thank you!

  • @knowledgeera3210
    @knowledgeera3210 2 роки тому +2

    why we are passing in Context as we are not using that in cosumner

  • @URRonaldo6724
    @URRonaldo6724 2 роки тому +2

    Finally Confusion got clear .Thanks for Making such types of videos...

  • @raunak0811
    @raunak0811 11 місяців тому

    best explanation i got after watching 20 videos

  • @electroviper5931
    @electroviper5931 3 роки тому +1

    2:11 most funniest part of this tutorial so far 😆

  • @deepikakapoor9607
    @deepikakapoor9607 4 роки тому +2

    Thank you so much ☺️ n voice ko edit kiya hai na apne.. bold acha lag rha hai

  • @Niteshmaurya1234
    @Niteshmaurya1234 6 місяців тому

    bhai mast video thi ek dam samjh a gaya

  • @sweekardahal9811
    @sweekardahal9811 3 роки тому

    You're a great teacher . I really appreciate your videos .

  • @pratikfulkar4335
    @pratikfulkar4335 3 роки тому +1

    bhai bhai jabardast
    maza hi aa gaya

  • @debopamseal1072
    @debopamseal1072 3 роки тому

    Ghanto waste hone se bacha diya. Succinct and informative!

  • @major7055
    @major7055 2 роки тому

    that was very simple and easy to undestand, thankyou

  • @prateek4524
    @prateek4524 3 роки тому +1

    amazing explanation thankyou so much..🔥💪💪

  • @binodkhatri7738
    @binodkhatri7738 2 роки тому

    Thankyou ,,awesome video, easy to understand, keep providing this kind of video❤

  • @rajat-s-kale1771
    @rajat-s-kale1771 Рік тому

    Your teaching is awesome bro

  • @zakiasultana1234
    @zakiasultana1234 2 роки тому +2

    U made everything easy.Lots of thanks and respect.No doubt u r the best of best.

  • @covidnineteen5249
    @covidnineteen5249 4 роки тому +2

    Sir love your videos.Sir ek local storage pe video bnaoge pls

  • @periodictech4248
    @periodictech4248 3 роки тому

    Bhot easy explanation kia h.. Thanks

  • @gmmkeshav
    @gmmkeshav Рік тому

    Wa Vinod bhai you killed it

  • @tarunjoshi1106
    @tarunjoshi1106 4 роки тому +3

    Sir COVID 19 india ke api ka use krke React Js mai bhi bnao 👌☺️
    Jo data ko display kre properly 😋👌

  • @akashvenu359
    @akashvenu359 2 роки тому +1

    I like the part when you say "boom guys"..Thank you for the superb content

  • @AdityaG.
    @AdityaG. 9 місяців тому

    "Context Hell" could be the perfect word... BTW great video..thanks

  • @yashkore7030
    @yashkore7030 4 роки тому +2

    bro ur explanation is super and each video is uploading morethan 1time in the playlist can u resolve this issue

  • @webdeveshverma3214
    @webdeveshverma3214 2 роки тому

    love u sir ji maja aagya topic clear

  • @sumitkawale9878
    @sumitkawale9878 2 роки тому +1

    we can create a variable with value and export it and directly access it in any component, then why we need this. In both cases exporting and importing is required. ulta simpla variable se code kam ho jayega..

  • @rahulpanchal6399
    @rahulpanchal6399 3 роки тому +9

    Hi, can u please arrange a tutorial for persisting redux state with multiple reducers. Thanks in advance.

  • @AnkitKumar-yf6wd
    @AnkitKumar-yf6wd 3 роки тому +1

    Thank you so much sir .

  • @ranjanvashist321
    @ranjanvashist321 2 роки тому

    And boom guys😍

  • @sandhyaaa24
    @sandhyaaa24 4 роки тому +2

    Difference between redux and context api??
    there is no App.jsx file in my react app

    • @shibinraja
      @shibinraja 3 роки тому +1

      it might be named app.js , js is a defined term for javascript xml . either of this is perfect. Redux is a global state management which store the data in the store and we can retrieve the values in the component where it is needed in spite of the parent / children component. Context api also does the same but not meant for large scale . In company projects ots used to maintain theme , small arc in it which can be changed when needed but not frequently.

  • @umaphalke5786
    @umaphalke5786 3 роки тому

    It helps me alot thank you👍🏻

  • @CodeWithSajjan
    @CodeWithSajjan 4 роки тому +1

    thapa bhai please also create a mega project using react js like ecommerce web app or chat app

  • @anandgomaskar2210
    @anandgomaskar2210 Рік тому

    thanku so much upload this video it 's need

  • @harshKumar-sr4mw
    @harshKumar-sr4mw 3 роки тому

    Great explanation sir thanks for this

  • @irushabasukala871
    @irushabasukala871 3 роки тому

    hellooo,Thapa technical!! you have explained so simply ,Thank youu and btw,your name seems to be Nepali?

  • @abdullahanwar8064
    @abdullahanwar8064 4 роки тому +1

    sir 1 confusion ha kay jab app.jsx main saye data export ho kar component C main show ho raha tho ap nay firsname context kay ndr compA ko kun rakha is matlab data tho link ha dubara hum agar

  • @lokeshnaidu1935
    @lokeshnaidu1935 2 роки тому +1

    You're awesome man, Very simple and cool explanation

  • @88advait
    @88advait 2 роки тому

    Amazing explanation..!

  • @nicetomeetugaming7024
    @nicetomeetugaming7024 2 роки тому

    Amazing video boss!

  • @dishashah4197
    @dishashah4197 11 місяців тому

    Great explanation 👍

  • @rafiqn2675
    @rafiqn2675 2 роки тому +1

    3 2 1 boom guys😄

  • @abcool0801
    @abcool0801 4 роки тому +1

    yahe to chahiye tha ab start hui h asli react to

  • @tubetalk007
    @tubetalk007 8 місяців тому +2

    3 2 1 and boom guys XD

  • @RohitKumar-dz8dh
    @RohitKumar-dz8dh Рік тому

    Thanks

  • @sushantrahane4512
    @sushantrahane4512 3 роки тому +1

    You can pass value by export import method also then why we use context api is it necessary?

    • @anonymous2982
      @anonymous2982 3 роки тому

      Yes i have this doubt too

    • @kushalthapa3548
      @kushalthapa3548 3 роки тому

      3 2 1 and boom guys. !!

    • @shehrozetalat2617
      @shehrozetalat2617 3 роки тому

      hard coded constant data yes, can be used via exports. But using context we can pass in states and setState method which constantly update.

  • @04.nehalsingh12
    @04.nehalsingh12 2 роки тому

    awesome tutorial sir

  • @shafihussain5282
    @shafihussain5282 Рік тому

    Thanks bro

  • @forza2718
    @forza2718 7 місяців тому

    "And Boom Guys " --ye bhi ek contest hai

  • @adnanyousaf4862
    @adnanyousaf4862 3 роки тому +1

    Brother I want to ask one question can you help me (I am perfect in frontend development but I am weak in programming logic building) can you help me

  • @mr.ramnani
    @mr.ramnani 3 роки тому

    oh godd loved that example xD

  • @rajbannasa7662
    @rajbannasa7662 3 роки тому

    thank you so much sir

  • @user-lj2sx7rg9f
    @user-lj2sx7rg9f Рік тому

    Rendering directly is not supported and will be removed in a future major release. Did you mean to render instead?
    I get this error what do I do?

  • @kashmirtechtv2948
    @kashmirtechtv2948 2 роки тому

    Good

  • @LearningWithNaveen
    @LearningWithNaveen 2 роки тому

    Consumer mai jo function bnaya hua hai, with name ka function hai, waise aise function ko kya bolte hai..... bhai ye muje smj nhi aa rha hai.

  • @innovative-thoughts
    @innovative-thoughts 4 роки тому +1

    useContent can be used out of the component? I'm doing so but getting error. Following the same method but getting an error on export { DataVar } "Parsing error: Export 'DataVar' is not defined"
    Please guide me. Thanks

    • @steplittle3516
      @steplittle3516 4 роки тому

      sir can u help me why value show undefined
      please check the code
      codesandbox.io/s/winter-moon-1zhmw?file=/src/App.js
      i have same problem sir can u help me

    • @shibinraja
      @shibinraja 3 роки тому

      @@steplittle3516 i cant see any prob in your file , you have used useContext to set up a consumer to Tab component

  • @jies933
    @jies933 Рік тому

    Thankss

  • @abhilashmund
    @abhilashmund 3 роки тому

    💥 guys

  • @jatinyadu9183
    @jatinyadu9183 3 роки тому

    Error: App(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.
    why this error occured

  • @thegorillaz4759
    @thegorillaz4759 4 роки тому

    Thank u so much

  • @banditalks
    @banditalks 4 роки тому +1

    Bro we can use props right i mean we can import component C in app.js and add some props we can use same props in compC by importing App right.... is that wrong practice????

    • @rehanhamayun1353
      @rehanhamayun1353 3 роки тому

      its better idea

    • @shibinraja
      @shibinraja 3 роки тому

      if you import compc , the details provided in com a and comb b wont be available in screen coz your providing directly and updating in virtual dom. Since, Vinod hasn't done anything in Com A and Com B , you thought it will be easy to import that, but if it has values in it. We have to use state management.

  • @meriChhotiDuniya
    @meriChhotiDuniya 3 роки тому

    I couldn't understand why we are nesting all the contexts? Suppose we have a bunch of contexts.then?

  • @sedmochill4707
    @sedmochill4707 3 роки тому

    😂 this specific tutorial is funny bcs of those errors

  • @nikhilnaidu1383
    @nikhilnaidu1383 2 роки тому

    And boom guys

  • @DeepakGupta-hj2dv
    @DeepakGupta-hj2dv 4 роки тому +1

    Flux pr video kab aayega....flux implementation

  • @savykansal3498
    @savykansal3498 3 роки тому

    Amazing

  • @deepaksharma69
    @deepaksharma69 Рік тому

    14:15 We have already export default App then why we need to export the FirstName again?

  • @solmindaudy
    @solmindaudy 3 роки тому

    Everything is at its best . Just stop using the word "PURRRFECT" ;)

  • @shibinraja
    @shibinraja 3 роки тому

    Bhai how come this is call back hell , we are not passing a function as an argument to another function where we will return the parameter and call the previous function indefinitely. I think the most suitable thing to refers is high order function which accepts a parameter as function and returns another functions. Btw , learned a lot from you. Thank you and keep going.

  • @mahmad8538
    @mahmad8538 3 роки тому

    Helpful 😇

  • @madhavjha844
    @madhavjha844 Рік тому

    Ye code react 18 me kaam nahi kar rha, context api ko react 18 me remove kar diya hai kya ??

  • @abhishekverma-dq6qc
    @abhishekverma-dq6qc 2 роки тому

    3 2 1 boooom Context API Funda clear.

  • @nikhil007g
    @nikhil007g 4 роки тому

    App m context h to aagar context ki value change hogi to sirf c refresh hoga ya a b and c ?

  • @creativeakshara8438
    @creativeakshara8438 4 роки тому +1

    Computer assembled 🤔
    Bhai please Canvas tutorials bana do🙏

  • @nomanahmed4085
    @nomanahmed4085 4 роки тому

    please make video on UseReducer.

  • @hamzailyas8632
    @hamzailyas8632 Рік тому

    I am getting this warning when i am returning any thing inside the Consumer. How can I solve this ?
    Warning: Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it

  • @dineshgaur1409
    @dineshgaur1409 4 роки тому

    Please add a video for context api with reducers

  • @amanrathore8810
    @amanrathore8810 4 роки тому +9

    Sir why r u calling in App.js ...

    • @RITIKJAINBCE
      @RITIKJAINBCE 3 роки тому +5

      becozz data of comC will pass to comB, data of comB will pass to comA, data of comA will pass to App.jsx....and finally data of App.jsx will pass to index.js

    • @shibinraja
      @shibinraja 3 роки тому

      coz thats the parent component of ComB and ComC. So the value from a to c or c to a (children to parent) has to be passed so that it can update in app.js which can update in index,js

    • @tayyabzaman7046
      @tayyabzaman7046 Рік тому

      Yup exactly same question.. If I consider these two answers than the question is why we use context... Because we say we want to directly exchange data between App.jsx and comC.jsx
      So the question is again
      Why we import comA in App.jsx?

  • @dp8579
    @dp8579 3 роки тому +1

    The game was - "chinese whispering"

  • @ujjwaljain9780
    @ujjwaljain9780 3 роки тому

    why my component is rendering when i passing "hello world " in compA and calling comA in App.js ,anyone have any idea

  • @htsscreatorshtsscreators7674
    @htsscreatorshtsscreators7674 4 роки тому +1

    Waiting for a website in react js

  • @abdullahirshad1276
    @abdullahirshad1276 3 роки тому +1

    Sir is it a replacement for redux?

    • @kashmirtechtv2948
      @kashmirtechtv2948 2 роки тому

      Yes. UseContext hook and Context Api when work together minimize the need of Redux to a great extent.

  • @razikkhan2637
    @razikkhan2637 4 роки тому +1

    Sir component c ko bhi to hum directly App.js me call krr skte hai import krk

    • @shibinraja
      @shibinraja 3 роки тому

      if you import compc , the details provided in com a and comb b wont be available in screen coz your providing directly and updating in virtual dom. Since, Vinod hasn't done anything in Com A and Com B , you thought it will be easy to import that, but if it has values in it. We have to use state management

  • @adilrao7777
    @adilrao7777 4 роки тому +1

    This is oxm vedio...
    But Sir how we can pass the value without wrap a component inside Context.Provider??
    Like,
    No any component...
    Onliy some JSX
    Sir plz answer this.. kindly

    • @shibinraja
      @shibinraja 3 роки тому

      without any component to whom you are providing the value?

    • @skskssss126
      @skskssss126 2 роки тому

      what's the use of context if you don't want to pass down value

  • @hemanttopi1
    @hemanttopi1 2 роки тому

    Can I pass data throw props. And how will be achieved. I am tried but not success

  • @mdzohaib7368
    @mdzohaib7368 3 роки тому

    I am getting an error- TypeError: Render is not a function.
    Can anyone help me!

  • @user-lw8gn8xb2t
    @user-lw8gn8xb2t 6 місяців тому

  • @punjabikids2942
    @punjabikids2942 2 роки тому

    I am not getting that why you import 'ComA' inside App.jsx and use while working with "createContext" . if I import either of ComB Or ComC inside "App.jsx" even then the project also works.
    Request to povide the Clarification on it
    Regards

    • @skskssss126
      @skskssss126 2 роки тому +1

      the main use of context is to drill or pass data to children component which is very complicated if you use props because you will have to pass props in every component in the hierarchy to get to the lowest component. That's why he made ComC so that he can show how to pass data from parent element i.e. App> ComA>ComB>ComC.

  • @shoaibz1112
    @shoaibz1112 2 роки тому

    Is there any way to find child components which using same props from upper level.

  • @AdityaVerma-fv5ne
    @AdityaVerma-fv5ne 4 роки тому

    Thanks Sir , This helped me a lot .

  • @salilbhatnagar9736
    @salilbhatnagar9736 2 роки тому

    I call in context API used in API Call is possible

  • @shariqansari7426
    @shariqansari7426 4 роки тому

    we can use multiple values with single context Api for first and last name no need to repeat code

    • @Unknown-Stranger
      @Unknown-Stranger 3 роки тому

      using objects? we pass the object in the value of Provider

  • @kishor-jena
    @kishor-jena 2 роки тому

    child element kaise parent element ko value pass karega using contexts?

  • @aakashsingh533
    @aakashsingh533 Рік тому

    Thapa technical 🍵

  • @DeepakGupta-hj2dv
    @DeepakGupta-hj2dv 4 роки тому +1

    Redux pr bhi video bnayoge kya please reply?