React Axios | Tutorial for Axios with ReactJS for a REST API

  Рет қаралды 295,484

Adrian Twarog

Adrian Twarog

Күн бұрын

Пікірлер: 182
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
I am trying to grow my channel, so if you find this video useful, #subscribe & hit the #bell :) Thanks for watching and hope you liked and learnt something new!
@juliosantiesteban7709
@juliosantiesteban7709 3 жыл бұрын
i guess you should update this tutorial to show it with functional components and hooks, also how to use the API variable in the whole project. Its also a good idea to give styles to the new elements you are using, even if you dont put the whole process in the tutorial, the visuals are importants
@marlonxander3559
@marlonxander3559 3 жыл бұрын
I guess it is kind of randomly asking but does anyone know of a good website to stream newly released tv shows online?
@gerryjtierney
@gerryjtierney 2 жыл бұрын
The move from components to functions has genuinely rendered 99% of these tutorials absolutely obsolete
@blackswann9555
@blackswann9555 3 жыл бұрын
my hair loss from last night is returning! thank you for this video, you bring zen to my day!
@Migler1
@Migler1 2 жыл бұрын
Lol magnificent comment
@hrishabhgoel6876
@hrishabhgoel6876 2 жыл бұрын
apt representation of a developer who just found an explaination to something that was about to take their life.
@jasper5016
@jasper5016 2 жыл бұрын
This is so so simple tutorial. I am totally impressed. Can you please update this with latest hooks and functional components? Thanks again!!
@samirkha
@samirkha 5 ай бұрын
Love you, sir. thanks for making this video so easy and fast. Very helpful, and easy to understand in fast-paced learning. Lots of love and support.
@luckysuraj1436
@luckysuraj1436 3 жыл бұрын
Very good and exact explanation of all requests . Just love the way you explain things so easily .
@usmanmunir1559
@usmanmunir1559 4 жыл бұрын
This video was really so helpful for me and I got a better idea of what a axios is and how to use it , Thanks for such a content , Keep making videos like this
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Great to hear
@yasyaindra
@yasyaindra 2 жыл бұрын
i want to code as confident as this guy is
@charlescampista9384
@charlescampista9384 3 жыл бұрын
Simple and direct the way it should be. That's great, thanks!
@AdrianTwarog
@AdrianTwarog 3 жыл бұрын
Thanks!
@onyedikachierugo4120
@onyedikachierugo4120 4 жыл бұрын
Wow great content and straight to the point, I immediately sub to you cos of the video, was actually looking for a perfect way to make a patch request
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Awesome man, happy I could help :)
@jboyle453519
@jboyle453519 2 жыл бұрын
man you make it look so easy
@warehousevirtuals
@warehousevirtuals 4 жыл бұрын
This video made me sub to you, pretty straight forward no chit chat just info, tnx dude
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Wingman thanks that was my goal. I just want to focus on doing straight to the point videos for those wanting to learn a library or framework. Usually research the core aspects in advanced so you don’t have to waste time watching me fix my own bugs or issues.
@warehousevirtuals
@warehousevirtuals 4 жыл бұрын
@@AdrianTwarog Keep it up dude (Y)
@swojchwat
@swojchwat Жыл бұрын
Brief and easy to follow. Thanks. BTW you have very nice poilsh surname ;)
@cheesypoofs3330
@cheesypoofs3330 3 жыл бұрын
These are exactly what I wanted to hear
@toberixng
@toberixng 4 жыл бұрын
I like it straight to the point. Thanks
@hammadansar1059
@hammadansar1059 3 жыл бұрын
You are too good at it. Good Job! Very Helpful
@amirmohg1319
@amirmohg1319 2 жыл бұрын
great tutorial, might wanna update it since react mostly relies on functions now
@kajalanthikat5199
@kajalanthikat5199 4 жыл бұрын
Adrian , straight the point - awesome !!!!!!!!!
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Thanks!
@Damian-qc2
@Damian-qc2 Жыл бұрын
Great! Quick nad precise! 🎉
@singh-guri
@singh-guri 3 жыл бұрын
Best video ever. Explained easily and made it really simple.
@PavanKumar-bj7mo
@PavanKumar-bj7mo 3 жыл бұрын
Well explained Adrian, thank you for the video.
@siddhesh8633
@siddhesh8633 3 жыл бұрын
Nice, I like the way you teach, please make a video on Software Development Lifecycles.
@aashiqahmed5273
@aashiqahmed5273 3 жыл бұрын
A very great video for me Adrain, my doubt is, how do you host another API instance running on another port, did you used JSON-server?
@sambhajisubhashphalke2800
@sambhajisubhashphalke2800 2 жыл бұрын
You are not a actor you are a programmer , The simple behaviour explanation can be fine.Thank you by the way
@jonasbalsys3696
@jonasbalsys3696 2 жыл бұрын
Best tutorial ever!
@AdrianTwarog
@AdrianTwarog 2 жыл бұрын
Thanks!
@luisluiscunha
@luisluiscunha 3 жыл бұрын
Amazing job: thank you, Adrian!
@iJustTeen
@iJustTeen 4 жыл бұрын
After spending 30 minutes on this video and I was writing out comments as I went when I get to the end I finally figured out that this is not the type of tutorial that people can do themselves it's a "FOLLOW ME" so not very helpful to me a react newbie. I did understand what you were talking about but only because I have watched many other react axios videos where the person talked slower and made the course over many (30) videos. I can appreciate how hard it is to be a creator but I think you may want to watch others videos and see how they do things. Thanks and good luck.
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Thanks for the feedback, this is useful. I took the time review what most tutorials for axios and react provided, and tried to compile them all into one video that’s a little quicker. However I can try do a bit more in depth version that goes into better depth to explain each part.
@angellovesjazz
@angellovesjazz 4 жыл бұрын
i had to slow the speed down. im new too.
@adrianchojnacki6884
@adrianchojnacki6884 2 жыл бұрын
Very nice tutorial.
@fernandomartinez7706
@fernandomartinez7706 2 жыл бұрын
This helped me a lot, I have to thak you!
@anjanam9355
@anjanam9355 3 жыл бұрын
very helpful tutorial
@AdrianTwarog
@AdrianTwarog 3 жыл бұрын
Great to hear :)
@jirikrajnak9047
@jirikrajnak9047 3 жыл бұрын
why do you fetch data from the constructor and not from a component lifecycle hook? calling it from the constructor can cause your setstate to trigger before the component did mount.
@bouchrayousra257
@bouchrayousra257 3 жыл бұрын
Very useful, thank you
@srikanthmogiligundla738
@srikanthmogiligundla738 4 жыл бұрын
Adrian Twarog, I personally felt this video was not 100 percent useful to me as it didn't show me the execution. Code part we can manipulate once we understand the complete flow.
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
no worries, if there are things you suggest for improving for next time, happy to hear them
@isbeb507
@isbeb507 3 жыл бұрын
this was very useful, thanks
@jackepner9984
@jackepner9984 Жыл бұрын
It's like you're jumping in mid-project without explaining where you're at. Where are you getting that json data from on your localhost?? And why wouldn't you create a backend for an API request when you typically have a key you need to hide?
@tobiamodu2367
@tobiamodu2367 4 жыл бұрын
Thank you Adrian!
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Tobi Amodu of course happy I could help!
@rohitshaw4324
@rohitshaw4324 3 жыл бұрын
great explanation. thanks
@shaunpant7152
@shaunpant7152 Жыл бұрын
What is the difference between constructor(){super()api.get()} and componentDitMount(){api.get()}?You say the constructor runs every time the component mounts, isn't componentDidMount() the same? Please help
@shahedabbas5265
@shahedabbas5265 4 жыл бұрын
Thank you, very nice video. Keep going :)
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Thanks, will do!
@emi_yoda1126
@emi_yoda1126 3 жыл бұрын
thanks you save mi life congrats
@AdrianTwarog
@AdrianTwarog 3 жыл бұрын
:)
@codemedic
@codemedic 4 жыл бұрын
Love the video!!! 👏👍. What font and theme are you using?
@rahulsriram6295
@rahulsriram6295 4 жыл бұрын
Hack Font and Ayu One Dark Theme maybe
@fcandann
@fcandann 3 жыл бұрын
Thank you very much :))
@AdrianTwarog
@AdrianTwarog 3 жыл бұрын
Sure!
@chrisdietrich1533
@chrisdietrich1533 3 жыл бұрын
excellent video. thanks
@guccigreatness4925
@guccigreatness4925 4 жыл бұрын
can u do this with useState and functional components 😢
@DipeshMalvia
@DipeshMalvia 3 жыл бұрын
I have made a video on CRUD with hooks and functional component. If you still looking for it do check my video.
@guccigreatness4925
@guccigreatness4925 3 жыл бұрын
@@DipeshMalvia thanks i will check it out 👍😅
@guccigreatness4925
@guccigreatness4925 3 жыл бұрын
@@DipeshMalvia can you give me a link to the video 😅
@DipeshMalvia
@DipeshMalvia 3 жыл бұрын
About to publish in some time I will update you once it gets published.
@DipeshMalvia
@DipeshMalvia 3 жыл бұрын
The video is published you can just click on my profile and check it won't be fair I add my KZbin video link in Adrian's video comments.
@shintopaul1018
@shintopaul1018 4 жыл бұрын
Thank you!! Explained well in such a short.. could you make a video of Json Web Token(JWT) also?
@TheMenny10
@TheMenny10 4 жыл бұрын
Awesome video! quick question what theme are you using on VSCode?
@rahulsriram6295
@rahulsriram6295 4 жыл бұрын
Ayu One Dark Theme
@rizqiyaputra88
@rizqiyaputra88 4 жыл бұрын
it's usefull tutorial .... thanks
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Glad it was helpful! :)
@jmgomw7787
@jmgomw7787 4 жыл бұрын
hi there, it is actually good video and well explained! thanks.. An small question, how did you managed to overcome the CORS blocking pitfall when consuming an API that resides in a differente host than the react app?
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
You can set cors settings on both the backend and the front end settings on systems so I opened those up
@mahkamehfallah8321
@mahkamehfallah8321 4 жыл бұрын
Thank you Adrian :*
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Ghazale fallah your welcome :)
@mahkamehfallah8321
@mahkamehfallah8321 4 жыл бұрын
@@AdrianTwarog Dear Adrian can I follow you on instagram?
@mahkamehfallah8321
@mahkamehfallah8321 4 жыл бұрын
@@AdrianTwarog Dear Adrian I have a big problem with storybook .can you help me?
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Sure!
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
I haven’t used it before, but good idea for a video!
@jasper5016
@jasper5016 2 жыл бұрын
Why dont you do a small React course? You will get great response.
@Submersed24
@Submersed24 2 жыл бұрын
What's the difference between this and any other request handler like superagent? Don't they just do the same thing?
@DevOpsHasan
@DevOpsHasan 3 жыл бұрын
Last part about change authentication header depend on user login how to change it, please share an example.
@leoshrek2201
@leoshrek2201 2 жыл бұрын
Why use then inside an await function. Your code can be simplified. const { data } = await axios.get(‘url’)
@Dcoding4ever
@Dcoding4ever 4 жыл бұрын
Nice video !, Can you make the same example but with functional React and promises
@radmehrdehghani9240
@radmehrdehghani9240 3 жыл бұрын
very good
@PrakharGupta36
@PrakharGupta36 3 жыл бұрын
Thank you sooo much
@cliomaas7598
@cliomaas7598 3 жыл бұрын
Hi! Great video! I have a question that has been hauting me for a while hahaha How can i make a post request with axios to save a foreign key in my db? I'm trying to make it using this state but it seems impossible :(
@johnsunnyjohnsunny4296
@johnsunnyjohnsunny4296 2 жыл бұрын
sir I already have website and I'm trying to build an app and how to get the user data from web to my app ..pls help me sir I'm stuck
@aleksneso634
@aleksneso634 2 жыл бұрын
Not working for me. He throws an error that there is a ';' missing in the Constructor but its still there even If I add ';'
@vaclavvlcek4527
@vaclavvlcek4527 3 жыл бұрын
Adrian, thank you for your effort making explanation videos. I just wanted to let you know that the music at the beginning is kind of annoying :) And one more thing, you might also slow down a bit by explanation. Not offence, I can imagine how difficult it must be to create such videos, I just thought you might appreciate some additional feedback :)
@FilipposSdralias
@FilipposSdralias 3 жыл бұрын
When I deploy my app to Vercel I get a cors error. How can I surpass this? Also what I have done is to hide the api key from the Axios call.
@TheNamesJT
@TheNamesJT 3 жыл бұрын
How do you get data from a public api using axios? this video looks like your setting up your own api. I want to grab data from another api online?
@AdrianTwarog
@AdrianTwarog 3 жыл бұрын
Might do a future video for something like this!
@michaelrooze278
@michaelrooze278 3 жыл бұрын
How are you not using let or const for the function expressions?
@shiyammosies5975
@shiyammosies5975 3 жыл бұрын
Need a huge favour: While registering a user into the database, before doing that I check if the user exist if not I proceed with registering process. However since Axios method is async, rest of my code proceeds without waiting for the response. How do I make it synchronous?
@motadaymane3262
@motadaymane3262 4 жыл бұрын
Cool content, how about making any react / react native course regarding structure of your project for large scale apps :)
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Great suggestion! Adding it to my list for future videos :)
@chiraggupta2561
@chiraggupta2561 4 жыл бұрын
I used node as a backend to fetch data in react but it show me provisional header are shown.
@omerakkoca8263
@omerakkoca8263 3 жыл бұрын
When i try to get api call in some web address, i get cors error. How can i solve cors error with use axios? can you help me?
@buggplayer2301
@buggplayer2301 3 жыл бұрын
Big fan
@guilhermerio
@guilhermerio 3 жыл бұрын
how do i make a search on my db and show the results (select)?
@shubhajithalder2054
@shubhajithalder2054 3 жыл бұрын
How easy things can be. Was breaking my head for 5 hrs and could not find a easier way to use axios.
@ariphharts
@ariphharts 6 ай бұрын
I like the way you teach, but take into account not everyone uses class-based components in react
@alexlui1
@alexlui1 2 жыл бұрын
good overall but 3 lines of code with no space or new line? hard to read for everyone
@esmameral1349
@esmameral1349 3 жыл бұрын
Hi Adrian, When I apply your code in my project I got this error: "Warning: Can't call setState on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the Home component." I think I should use componentDidMount() lifecycle method. This is my code, can you help me, please? class Home extends React.Component { state = { productList: [] } constructor(props) { super(props); api.get('/').then(res => { const productList = res.data; this.setState({ productList }); }) this.onDelete = this.onDelete.bind(this); this.onAdd = this.onAdd.bind(this); } .... }
@IggyBudiman
@IggyBudiman 2 жыл бұрын
I did get the same error too. Seems like this tutotial doesn't work.
@KrishnaRamchandani
@KrishnaRamchandani 3 жыл бұрын
I'm getting this error related to network -> Unhandled Rejection (Error): Network Error does anyone knows how to solve it.
@baetraki7268
@baetraki7268 3 жыл бұрын
how about knowing the login, logout state of a user???
@RyanPetersons
@RyanPetersons 4 жыл бұрын
Side Question. How is your editor soooooooo smooth!?
@MuhammadYusuf-hk8pg
@MuhammadYusuf-hk8pg 3 жыл бұрын
same question
@ericelsner1553
@ericelsner1553 3 жыл бұрын
Why not use functional components?
@devappsinvo5405
@devappsinvo5405 4 жыл бұрын
really cool :)
@Hedenica
@Hedenica 4 жыл бұрын
What is your icon extension on vsc 😁 ?
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
I’ve made a recent video on vscode plugins and it’s vscode-icons package
@vibelover5444
@vibelover5444 3 жыл бұрын
yo... why are you still using class components???????
@kg_3415
@kg_3415 4 жыл бұрын
Can you please make a video of dynamic sidebar menu in react please
@Shubham-xh9nz
@Shubham-xh9nz 4 жыл бұрын
why not hooks ? , functional components are
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
shubha might have to do a video dedicated to hooks. I need to learn to use them properly!
@hi_im_willow
@hi_im_willow 2 жыл бұрын
can someone show me how to create a single view using api
@HelluGoes
@HelluGoes 4 жыл бұрын
Is there a reason you're using classes and not functions and hooks as it is todays "standard"?
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
because i made this yonks ago!
@shyrenmore8140
@shyrenmore8140 3 жыл бұрын
How to use axios with react hooks?
@ismoiljonabduqahhorov5825
@ismoiljonabduqahhorov5825 3 жыл бұрын
lol you got one more subcriber)))))
@comment8767
@comment8767 3 жыл бұрын
link to completed source?
@AdrianTwarog
@AdrianTwarog 3 жыл бұрын
Doco and code on the main site I think :) reused guild line examples
@adityaheart9671
@adityaheart9671 3 жыл бұрын
@@AdrianTwarog can you please tell me how can I cache api responses ? I'm using axios to get data from api and I don't want to request the same data everytime I visit the page. Please link resources where I can learn this please 🙏🙏🙏
@mujahidislamkhan782
@mujahidislamkhan782 3 жыл бұрын
delete is not working.
@AdrianTwarog
@AdrianTwarog 3 жыл бұрын
Check doco for specifics!
@jheyssonurbano7368
@jheyssonurbano7368 3 жыл бұрын
Try this: onClick={()=>deleteCourse(course.id)}
@shredderlinic
@shredderlinic 4 жыл бұрын
Class components called, they want to retire.
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
True, I’ve started learning, I’m old!
@marcofabiopavone5027
@marcofabiopavone5027 4 жыл бұрын
At 2:37 I'm getting a TypeError: "this.state.courses.map is not a function".
@SamiKhammar
@SamiKhammar 4 жыл бұрын
probably you are using a functional component , try " courses.map " instead
@learn9329
@learn9329 3 жыл бұрын
Next time please explain in more detail and may be not so fast. Difficult to catch up for beginners.
@mackynikat8833
@mackynikat8833 3 жыл бұрын
. i always had an network error boss
@localblackman427
@localblackman427 2 жыл бұрын
is there source code from this anywhere?
@CANIHAZURDREAMSPLS
@CANIHAZURDREAMSPLS 3 жыл бұрын
Would be better if taught slower and explained in depth the different api and functions
@eleazarfederio1718
@eleazarfederio1718 4 жыл бұрын
i'm noob in react, why your app.js in react project is have a class called App and mine doesn't have i use npx create-react-app?
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Syntax can be anything, react has a few functional or class components
@aashiqahmed5273
@aashiqahmed5273 3 жыл бұрын
Before hook was not a major thing,React ships with class components with boilerplate CLI but now its functional components
@RaviKumar-lp6nz
@RaviKumar-lp6nz 3 жыл бұрын
Now I understand why so many dislikes
@migueldomingos4570
@migueldomingos4570 3 жыл бұрын
Using class components is not good bro
@AdrianTwarog
@AdrianTwarog 3 жыл бұрын
This vid was a long long time ago :)
@migueldomingos4570
@migueldomingos4570 3 жыл бұрын
@@AdrianTwarog Then let's hope that the gods forgive you😂
@Human_Evolution-
@Human_Evolution- 3 жыл бұрын
It's data, not data.
@sebastianussembara3463
@sebastianussembara3463 4 жыл бұрын
how to set token in headers to get api for protected api with jwt
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Might need to check the doco for that
@tommyleong8328
@tommyleong8328 4 жыл бұрын
Great content on ReactJs! Would love to request a media query content if possible (: @Adrian
@AdrianTwarog
@AdrianTwarog 4 жыл бұрын
Tommy Leong sure will do thanks!
@tommyleong8328
@tommyleong8328 4 жыл бұрын
I actually did it! Maybe can share techniques or things to take care while developing a mobile first website 😊
Use Axios with React Hooks for Async-Await Requests
36:01
Dave Gray
Рет қаралды 57 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 19 МЛН
Каха и лужа  #непосредственнокаха
00:15
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 22 МЛН
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 6 МЛН
Axios Crash Course | HTTP Library
42:20
Traversy Media
Рет қаралды 370 М.
How to integrate OpenAI GPT3 with a Databases - Crash Course
16:49
Adrian Twarog
Рет қаралды 298 М.
OpenAI Embeddings and Vector Databases Crash Course
18:41
Adrian Twarog
Рет қаралды 488 М.
React Axios API Requests | Axios with React JS Tutorial
38:32
Dave Gray
Рет қаралды 145 М.
Sending JavaScript Http Requests with Axios
11:50
Academind
Рет қаралды 175 М.
4 Reasons Why Samsung are in Trouble
9:16
TLDR Business
Рет қаралды 39 М.
What is a REST API?
9:12
IBM Technology
Рет қаралды 1,6 МЛН
Fetching Data in React - Complete Tutorial
29:10
Cosden Solutions
Рет қаралды 136 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 19 МЛН