Thanks, I love this shorts you do where you explain key concept in JS or React simply for anyone to understand. They have been really helpful and understandable. Please keep doing them. Could you do some on using axios in react and also how to display data you fetch from an api on the browser. Thank You.
@CodeWithRia10 ай бұрын
Also fetching data from an API that doesn't have id or page param.
@richardbray10 ай бұрын
Sure thing, I'll add it to the list
@thecodebear Жыл бұрын
Nice video👍
@conradhansen-quartey5053Ай бұрын
Explained well - thank you!
@richardbray18 күн бұрын
You're welcome!
@richochet6 ай бұрын
Brilliant 👏🏼
@No_one123514 ай бұрын
Awesome information!
@akashofficial58698 ай бұрын
Gud🎉
@SingularityFe3 ай бұрын
Yup, this is what I've started doing at work
@sxuwrrАй бұрын
Axios will help brother
@Atomistry6 ай бұрын
This is really helpful but how do you display the data that has been returned by the api?
@richardbray6 ай бұрын
Currently just logging it to the console but if you had a framework you could just display the data in a templating language
@factcinemaaa5 ай бұрын
From India
@guywhoplayz60422 ай бұрын
Or just chain it with thens and a catch
@Omaxim16389 ай бұрын
Pls do for C++
@zahreddinesoualem321310 ай бұрын
Sir, I am golang developer, I dound myself forced to build a website with react and go, can you give quick tip how to access each element from json individually?
@richardbray10 ай бұрын
Hmmm, I'm not sure I understand. Why would you want to do that in the first place?
@zahreddinesoualem321310 ай бұрын
Long story, anyway thanks for your response I found my way to the what I was looking for.
@WidowSoundsNoCopyright9 ай бұрын
how do i access a random 3rd party api? For me, nothing is happening when I try to fetch from it even though I did what you did.
@richardbray9 ай бұрын
What error are you getting?
@WidowSoundsNoCopyright9 ай бұрын
@@richardbray im not getting any error. Its just either printing nothing to the console (even though I'm printing the data and) or it just says undefined. Im using a pretty unpopular API so I don't know if that's the reason or not. But it should work.
@ahmedahmedx96006 ай бұрын
But what if i dont want js to run the next line before getting data first ? Is there a way to block js in fetch line
@richardbray6 ай бұрын
You'd have to put the code you want to run next in the promise resolve section, so the then method or create a promise with the code and await it, if that makes sense. Happy to make a video if it doesn't.
@ahmedahmedx96006 ай бұрын
@richardbray yes I got it but not 100% 😅, so if you can do a video about that topic I'll be grateful 💙
@kseperepere505 Жыл бұрын
How different is it from getting data from maybe a Github repo
@richardbray Жыл бұрын
It's not common for data to be kept in a github repo. If you wanted to get data from the ChatGPT api, you would need an api key which isn't available via github
@user-xq5cg4jo4y9 ай бұрын
bro if we want to print that data into document ? then how can we use ??
@richardbray9 ай бұрын
You can create an element with JavaScript and use innerHTML or innerText to add data to it. Or you could use a framework like React
@33v4.11 ай бұрын
when/how do you that you can fetch without using async await?