React Update Operation using Hooks and Axios

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi this is Miranda and again from bin Sarah limiter in today's lecture I'm gonna walk you through update operation in reactors using hooks and axles so let us start okay update is very simple will create a on click event here on the given here we don't look event we say no update so I'll say update and I'm gonna say I turned out category a via so item category ID here so you're gonna pass the category ID when button is clicked okay and you're gonna create that function here function update plus ID after - console dot log ID so you're gonna see if we are getting ID or not if you're getting ID we are successful so I'm sold or inspected and in console here we are getting ID we are getting IV we are getting ID card so that's fine so just clear that off no for a sec so we couldn't get now you're gonna what you're gonna do as we're getting ID props doors for history door push so we're gonna push that into another page where a prepaid is so history touch push this on to the page name called update update but we are going to pass ID with it okay also the here is the update page so you gonna pass from here to this update page here so to make the video shorter I'm gonna copy everything from here orange and I don't put that control C control me here and after that so up to handle function here sorry up to submit and handy thank you yeah control C and hang on so I'm gonna be props here pros I don't forget - now hang on paste that here so we don't need this remote function sorry you don't need this remote function so you're gonna give it - time delays to save and we gonna get the form up from here so the form control C get the form from here and control D to be kinda nice to see you we go to form and now what we gonna do symbol here just we are passing ID from the other page so here we are we are going to store that embeddable cones IV equal to properties torch much torch parameter is touch ID okay and we're gonna pass that ID on to this URL here so we're gonna pass ID here after passing the ID so you can come and touch you can see we are getting ID in here such that not category okay and control let's just see you and see if you're getting so update we are getting that so it's fine cool so now we will start update I mean submit so here we got the a record when you click in that so and we submit that it should update so for - come to submit here and here also we need ID so gosh I leave you don't store that variable sorry not also concentration ID equal to a property stores much parameter stores forums store ID okay and we're gonna pass that ID well we're gonna use put function here for update and we're gonna pass the ID in here okay so you're passing the IV there okay ctrl s to save after that we don't need this one okay because we are going to push touch so properties dodge history don't push on to the main page that is this one so we can see the list once it is updated so once this record is updated it will push to the the front page or category page whatever to see them and to show the ListView okay so that's what we're gonna see I'm gonna change that in the test and submitted Chinese done and cause I'm gonna change that into for us here and I'm gonna submit submitter so here you can see it is getting updated okay so this is all for this video and thank you for listening have a good day
Info
Channel: Binsera Ltd Uk
Views: 10,373
Rating: 4.3000002 out of 5
Keywords: React tutorial, Reatc Hooks, React Axios, Reat JS, React latest release, React crud operation
Id: taxkiuT8WJM
Channel Id: undefined
Length: 6min 3sec (363 seconds)
Published: Sun Jun 02 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.