Context API in React JS in Hindi in 2020 #51

Sdílet
Vložit
  • čas přidán 11. 06. 2020
  • 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.thapatechnical.com/2020/0...
    ➡️ 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.thapatechnical.com/2020/0...
    ➡️ 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.thapatechnical.com/2019/1...
    ➡️ 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 CZcams 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.thapatechnical.com
    Instagram Link: / vinodthapa55
    Facebook Link: / vinodthapa55
    Twitter Link: / vb55thapa
    Facebook ThapaTechnical Page Link: vinodbahadur...

Komentáře • 226

  • @ThapaTechnical
    @ThapaTechnical  Před 4 lety +55

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

    • @tarunjoshi1106
      @tarunjoshi1106 Před 4 lety

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

    • @tarunjoshi1106
      @tarunjoshi1106 Před 4 lety

      🤣🤣🤣 wtf I was doing 2 months ago.

    • @letsknowthis1862
      @letsknowthis1862 Před 3 lety +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 Před 3 lety

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

    • @sallbro4134
      @sallbro4134 Před 2 lety

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

  • @ayyasudeen3118
    @ayyasudeen3118 Před 3 lety +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 Před rokem +2

      You need to learn Hindi bro

    • @raviiirathore9984
      @raviiirathore9984 Před rokem +1

      ​@@entertainmentcreations7661
      Why he should learn Hindi ?

    • @pradattaaryal3523
      @pradattaaryal3523 Před 7 měsíci

      @@raviiirathore9984vinod is from nepal pokhara

    • @luffydono0
      @luffydono0 Před 2 měsíci

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

  • @islamicbeautifulvibes454
    @islamicbeautifulvibes454 Před 7 měsíci +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

  • @fayeazahmedrhythm7460
    @fayeazahmedrhythm7460 Před 4 lety +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!

  • @sweekardahal9811
    @sweekardahal9811 Před 3 lety

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

  • @sugandhasharma5484
    @sugandhasharma5484 Před 3 lety +2

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

  • @binodkhatri7738
    @binodkhatri7738 Před 2 lety

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

  • @aniketmasram6500
    @aniketmasram6500 Před 2 lety +1

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

  • @yashtechofficial6724
    @yashtechofficial6724 Před 2 lety +1

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

  • @major7055
    @major7055 Před 2 lety

    that was very simple and easy to undestand, thankyou

  • @prateek4524
    @prateek4524 Před 3 lety +1

    amazing explanation thankyou so much..🔥💪💪

  • @tejendrarajawat4054
    @tejendrarajawat4054 Před 2 lety +12

    Your lectures are very underrated 👍

  • @raunak0811
    @raunak0811 Před 10 měsíci

    best explanation i got after watching 20 videos

  • @fansofmahabharat4399
    @fansofmahabharat4399 Před 3 lety +1

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

  • @gmmkeshav
    @gmmkeshav Před rokem

    Wa Vinod bhai you killed it

  • @soniapadhi7471
    @soniapadhi7471 Před 5 dny

    You are an amazing teacher! Thank you very much!

  • @harshKumar-sr4mw
    @harshKumar-sr4mw Před 3 lety

    Great explanation sir thanks for this

  • @zakiasultana1234
    @zakiasultana1234 Před 2 lety +2

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

  • @rajat-s-kale1771
    @rajat-s-kale1771 Před rokem

    Your teaching is awesome bro

  • @periodictech4248
    @periodictech4248 Před 3 lety

    Bhot easy explanation kia h.. Thanks

  • @pratikfulkar4335
    @pratikfulkar4335 Před 3 lety +1

    bhai bhai jabardast
    maza hi aa gaya

  • @deepikakapoor9607
    @deepikakapoor9607 Před 4 lety +2

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

  • @umaphalke5786
    @umaphalke5786 Před 3 lety

    It helps me alot thank you👍🏻

  • @debopamseal1072
    @debopamseal1072 Před 3 lety

    Ghanto waste hone se bacha diya. Succinct and informative!

  • @electroviper5931
    @electroviper5931 Před 3 lety +1

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

  • @lokeshnaidu1935
    @lokeshnaidu1935 Před 2 lety +1

    You're awesome man, Very simple and cool explanation

  • @akashvenu359
    @akashvenu359 Před 2 lety +1

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

  • @Niteshmaurya1234
    @Niteshmaurya1234 Před 5 měsíci

    bhai mast video thi ek dam samjh a gaya

  • @AdityaG.
    @AdityaG. Před 8 měsíci

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

  • @88advait
    @88advait Před 2 lety

    Amazing explanation..!

  • @nicetomeetugaming7024
    @nicetomeetugaming7024 Před 2 lety

    Amazing video boss!

  • @mr.ramnani
    @mr.ramnani Před 3 lety

    oh godd loved that example xD

  • @webdeveshverma3214
    @webdeveshverma3214 Před 2 lety

    love u sir ji maja aagya topic clear

  • @abdullahanwar8064
    @abdullahanwar8064 Před 4 lety +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

  • @covidnineteen5249
    @covidnineteen5249 Před 4 lety +2

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

  • @dishashah4197
    @dishashah4197 Před 10 měsíci

    Great explanation 👍

  • @user-lj2sx7rg9f
    @user-lj2sx7rg9f Před rokem

    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?

  • @irushabasukala871
    @irushabasukala871 Před 3 lety

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

  • @yashkore7030
    @yashkore7030 Před 4 lety +2

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

  • @04.nehalsingh12
    @04.nehalsingh12 Před 2 lety

    awesome tutorial sir

  • @knowledgeera3210
    @knowledgeera3210 Před 2 lety +1

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

  • @rahulpanchal6399
    @rahulpanchal6399 Před 3 lety +9

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

  • @AnkitKumar-yf6wd
    @AnkitKumar-yf6wd Před 3 lety +1

    Thank you so much sir .

  • @CodeWithSajjan
    @CodeWithSajjan Před 4 lety +1

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

  • @anandgomaskar2210
    @anandgomaskar2210 Před rokem

    thanku so much upload this video it 's need

  • @nikhil007g
    @nikhil007g Před 4 lety

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

  • @tarunjoshi1106
    @tarunjoshi1106 Před 4 lety +3

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

  • @jatinyadu9183
    @jatinyadu9183 Před 2 lety

    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

  • @shoaibz1112
    @shoaibz1112 Před 2 lety

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

  • @adnanyousaf4862
    @adnanyousaf4862 Před 3 lety +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

  • @sandhyaaa24
    @sandhyaaa24 Před 4 lety +2

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

    • @shibinraja
      @shibinraja Před 3 lety +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.

  • @shibinraja
    @shibinraja Před 3 lety

    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 Před 3 lety

    Helpful 😇

  • @12rehanglasswala90
    @12rehanglasswala90 Před 4 lety

    Amazing

  • @ujjwaljain9780
    @ujjwaljain9780 Před 3 lety

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

  • @abcool0801
    @abcool0801 Před 4 lety +2

    yahe to chahiye tha ab start hui h asli react to

  • @sumitkawale9878
    @sumitkawale9878 Před 2 lety +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..

  • @ranjanvashist321
    @ranjanvashist321 Před 2 lety

    And boom guys😍

  • @AdityaVerma-fv5ne
    @AdityaVerma-fv5ne Před 3 lety

    Thanks Sir , This helped me a lot .

  • @deepaksharma69
    @deepaksharma69 Před rokem

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

  • @DeepakGupta-hj2dv
    @DeepakGupta-hj2dv Před 4 lety +1

    Flux pr video kab aayega....flux implementation

  • @innovative-thoughts
    @innovative-thoughts Před 4 lety +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 Před 4 lety

      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 Před 3 lety

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

  • @hamzailyas8632
    @hamzailyas8632 Před rokem

    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

  • @rajbannasa7662
    @rajbannasa7662 Před 3 lety

    thank you so much sir

  • @madhavjha844
    @madhavjha844 Před rokem

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

  • @hemanttopi1
    @hemanttopi1 Před 2 lety

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

  • @thegorillaz4759
    @thegorillaz4759 Před 4 lety

    Thank u so much

  • @dineshgaur1409
    @dineshgaur1409 Před 3 lety

    Please add a video for context api with reducers

  • @meriChhotiDuniya
    @meriChhotiDuniya Před 3 lety

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

  • @pramod6844
    @pramod6844 Před 3 lety

    Hi Vinod, instead of createContext() with variable can we do it by array?

  • @sedmochill4707
    @sedmochill4707 Před 3 lety

    😂 this specific tutorial is funny bcs of those errors

  • @punjabikids2942
    @punjabikids2942 Před 2 lety

    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 Před 2 lety +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.

  • @SparkLearnHub
    @SparkLearnHub Před 2 lety

    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.

  • @banditalks
    @banditalks Před 4 lety +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 Před 3 lety

      its better idea

    • @shibinraja
      @shibinraja Před 3 lety

      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.

  • @mdzohaib7368
    @mdzohaib7368 Před 3 lety

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

  • @abhilashmund
    @abhilashmund Před 3 lety

    💥 guys

  • @mukulchaudhary8914
    @mukulchaudhary8914 Před 3 lety

    bro, please tell me how do you multi-line typing

  • @sushantrahane4512
    @sushantrahane4512 Před 3 lety +1

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

    • @anonymous2982
      @anonymous2982 Před 3 lety

      Yes i have this doubt too

    • @kushalthapa3548
      @kushalthapa3548 Před 3 lety

      3 2 1 and boom guys. !!

    • @shehrozetalat2617
      @shehrozetalat2617 Před 2 lety

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

  • @tubetalk007
    @tubetalk007 Před 7 měsíci +2

    3 2 1 and boom guys XD

  • @nomanahmed4085
    @nomanahmed4085 Před 3 lety

    please make video on UseReducer.

  • @shafihussain5282
    @shafihussain5282 Před rokem

    Thanks bro

  • @solmindaudy
    @solmindaudy Před 3 lety

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

  • @abdullahirshad1276
    @abdullahirshad1276 Před 3 lety +1

    Sir is it a replacement for redux?

    • @kashmirtechtv2948
      @kashmirtechtv2948 Před 2 lety

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

  • @aliadnanasim4420
    @aliadnanasim4420 Před 3 lety

    sir extention bta dain please apnay nichay createContext likha pr wo opper khud hi likha gaya is extention ka name bta dain plzz

  • @nazimfirdousali6952
    @nazimfirdousali6952 Před 3 lety

    How if i fetch the data in child A and show it to child B by context without making provider value in index/app.js

  • @MANISH-nb8wb
    @MANISH-nb8wb Před 4 lety

    Hello sir,please make video for photo resizer

  • @shariqansari7426
    @shariqansari7426 Před 4 lety

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

    • @Unknown-Stranger
      @Unknown-Stranger Před 3 lety

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

  • @creativeakshara8438
    @creativeakshara8438 Před 4 lety +1

    Computer assembled 🤔
    Bhai please Canvas tutorials bana do🙏

  • @adilrao7777
    @adilrao7777 Před 4 lety +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 Před 3 lety

      without any component to whom you are providing the value?

    • @skskssss126
      @skskssss126 Před 2 lety

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

  • @sandhyaaa24
    @sandhyaaa24 Před 3 lety

    hii whats difference here between js vs jsx file you created here

    • @shibinraja
      @shibinraja Před 3 lety +1

      React uses jsx to create a component which render to react component which can be seen in index,js. JSX is javascript xml . Extension doesnt matter when creating file everything is js object. the things written in a component should be of jsx , which takes js objects embeded in xml defined tags.

  • @sharadguragain6999
    @sharadguragain6999 Před 2 lety

    what if we passed compC directly to the parent components?

    • @ashokmehta3645
      @ashokmehta3645 Před 2 lety

      Best way to do this is to create context and state component sepratelty.And passing the component as props child

  • @razikkhan2637
    @razikkhan2637 Před 3 lety +1

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

    • @shibinraja
      @shibinraja Před 3 lety

      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

  • @htsscreatorshtsscreators7674

    Waiting for a website in react js

  • @Vijaysah07
    @Vijaysah07 Před 4 lety

    Sir ap app developer ka series lekar aaiye

  • @kishor-jena
    @kishor-jena Před 2 lety

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

  • @RohitKumar-dz8dh
    @RohitKumar-dz8dh Před rokem

    Thanks

  • @rafiqn2675
    @rafiqn2675 Před 2 lety +1

    3 2 1 boom guys😄

  • @user-lw8gn8xb2t
    @user-lw8gn8xb2t Před 5 měsíci

  • @munendrasingh848
    @munendrasingh848 Před 2 lety

    how to create a code in asp.net core web Api for dynamic otp generated in my mobile number using swagger on post method and we will be save all field (as name , EmployeeId and Mobilenumber etc.. )in Db also , Plz Sir tell me it's urgent.

  • @jies933
    @jies933 Před rokem

    Thankss