React js Tutorial - How To Get Data From An API With React
HTML-код
- Опубликовано: 4 май 2018
- If you like this channel and would like to support it i accept bitcoin donations to my wallet address:
1Fm3ZywfnioXjHpUbVppLvpzehvRq2vfQs
Build native apps for iOS & Android with drag and drop:
interactiveappbuilder.com/
Featured Full Courses I Recommend To New Developers:
React JS - The Complete Guide (over 150 000 devs enrolled)
click.linksynergy.com/deeplin...
React JS Web Development - The Essentials Bootcamp
click.linksynergy.com/deeplin...
The Complete React Js & Redux Course - Build Modern Web Apps
click.linksynergy.com/deeplin...
The Complete React Native + Hooks Course
click.linksynergy.com/deeplin...
React Native - The Practical Guide
click.linksynergy.com/deeplin...
The Complete JavaScript Course
click.linksynergy.com/deeplin...
Recommended VPS and dedicated servers for your hosting:
www.vultr.com/?ref=8317938
More Content:
React JS Tutorial - Create A Simple Login System Episode #1 of #3
• React JS Tutorial - Cr...
React js Tutorial - How To Use localStorage and sessionStorage
• React js Tutorial - Sa...
HTML/HTML5 from beginner to expert:
www.udemy.com/course/html5-in...
In this tutorial from fullstack development you will learn how to fetch data from an API in React using Javascript and the fetch function.
#keywords
react js api call
react js api
fetch data
api
Github repo for this application:
github.com/nordin-johan/tutorial-reactjs-fetch
Thank you! This has helped me tremendously. I didn't understand how to SetState with asynchronous data and this helped a lot. Great job!!!
You are welcome!
Great. Looking for this for past one week. Saved my day. Thankyou , became a subscriber
Thank you!
If you want to post data as well: ruclips.net/video/8SkiIAbFbNs/видео.html
Full Course For React JS - The Complete Guide: bit.ly/2oCrfH0
Amazing video! Thank you so much for making this very simple and easy to follow! Perfect!
Thank you!
Thank you so much for this tutorial!!! It solved a huge problem for me with data from response!
Thanks!
Thank you. this was very clear.
the API fetch component starts at 4:00
thanks
Thanks!
he didnt show the output? does this works actually?
End to end that was exactly what I need React for.
Thank you.
No problem
Too Much Love ...! This is what i was searching from basic to practical...!
Thanks!
This is exactly what I was searching for...thank you
You are welcome
A great introduction into fetching API data and what it would look like on code! thank you!
Thanks!
This is What I Expected. Thank you :)
You are welcome!
Thank you! You saved me from a mental breakdown with this tutorial... :D
You are welcome!
Easy-peasy to understand. Great job!
Thanks!
Thank you for the great tutorial. The tutorial is easy to understand. Liked and subscribed. :)
Thanks, you are welcome!
Great video, thanks for explaining things simply!
cricket62 thanks alot!
Great man exactly what I was looking for, Thanks
No problem!
Thank you so much!! Subscribed immediately!
Thank you so much, this is precisely what I was looking for.
Thanks!
@@FullstackDevelopment can you help me out with something? I'm sort of stuck.
It's not related to this though, so if you wouldn't mind, I'll ask.
Very useful for our "first steps". Thank you!
Thanks!
short video good explained, exactly what is needed ty a lot
Thank you!
You are amazing, thank you for your clear instructions.
You are welcome!
Thanks man great explanation as always :)
Thanks alot :)
how can we do this with functional components in react instead of classes?
Simple and objective. Great !!
Thanks!
it was great and useful for me.
thanks man
Thanks!
you just helped me with the exact solution thank you
very good , simple and learning video! more of those :)
LawZist Thank you!
Thank you for making this clear
No problem!
simple and helpful. Thank you.
Thanks!
thank you, this helped me a lot
Thank you .This was very helpful 👍🏻
You are welcome!
great video .....this is what beginners need
Thank you
Its right here: reactjs.org/docs/faq-ajax.html
Very nice..!! Thank you for this tutorial.
Thanks!
Thank you so much ! It is very understandable
You are welcome!
Thank you, Useful info.
Thanks alot!
Perfect ! Thanks Sir.
Thank you!
Thank you so much. I have seen so many videos to fetch the data using API in React and worked like that but nothing is worked. But your tutorial is very easy to understand and it is working too. Thanks once again.
Thanks!
thanks for so much for this video, it solved my problem
You are welcome!
Thank you! I solved my problem! :)
You are welcome!
Thank you,you saved my life!!
You are welcome!
what if am doing routing in the return section then how do I pass items to other components? I want to render items in other components and use it there how do I do this? do i need to fetch data for each component in order to use it there?
Amazing! thanks a lot!
Thanks!
thanks bro!!!! amazing and easily
Thank you for this. It's clear and looks easy. Ivhabe a question about 1 thing. I don't understand line 20.. items:json. What is json? Variable? Where does it come from? Or does it come from an arrow function?
adding return to the 1st .then(...), solves the problem:
---------------------------------------------------------------------------------------------------
componentDidMount() {
fetch("jsonplaceholder.typicode.com/users")
.then(response => {
return response.json();
})
.then(json => {
console.log(`received data:`, json);
this.setState({
isLoaded: true,
users: json
});
});
}
Hi
I have a collapsible in the HTML, and exactly similar code as you have shown here.
I have 5 such components each calling an API response. All components call API on the load of the page.
Like if API is responding 10 records then, i get 50 responses on each load.
My question : is it possible to call the API only when user click on the collapsible header? So that My API responds only 10 on demand and not on each load.
Very helpful. Thank you
Thanks man 🤘
Thank you for this great video.🙏👌
You are welcome
Many nice, thanks! :D
Thanks!
Genius explenation! Great job Sr!! Thanks *1M
Thanks!
ruclips.net/video/nPCfL_fuUk4/видео.html
live linkedin code easy understand line by line
Does anyone know how I would write the fetch() is I were accessing an API with a Bearer token?
hi, i wan to use camera plugin, as well as contact plugin in react native, but i did not understand how to use it, plz guide me with coding.....i iam using ubuntu with android phone.
thx man, the best
very nice explanation method !
Thank you very much, very useful.
Thanks!
thank u and love .. now i know how to integrate api Hureeeeeeee
Thanks!
thanks short and crisp .. :-)
really good work.. thanks
Thanks!
After I have practice this. I think I am ready for my first frontend developer job.
hey, did you et your first front.end job?
Go for it!
Great job!
Thanks!
thank you for this
Thank you!
Hi, can anybody help me out? I have done literally the same thing, I can get an error items.map is not a function. I'm confused.
The map function work only on arrays, you are not retrieving an array hence the error.
for anyone looking for this ..........for eg. the array (object) in your JSON data is named as "students",inside which you would have named all id,age,name etc............So basically now as map function work only on arrays so you have to do items.students.map
@@abhisheksharma8210 thanks man
hi it is very helpful and i need how to store form values into db backend springboot front end react js....its very important for me...
I hv a question. How do we connect our React app to backend like to Node js and then work on database maybe Mongo db. What if i don't wanna work with API then how?
Thank you sir!
Thanks!
What keyboard do you use? It sounds so dope!
I have blob http response, so I need to store this into cache and it will help to call for the second click within the period of time instead of calling API again
Hello,I did same as you but a blank page is shown.no any data.a warning in console contains, deliver cookies with cross-site-requests....What to do in this case.plz suggest.
I did exactly like you instructed but data never fetched. I checked the webservice and data is returned from soapui as json format.
What is the color of the switches of your keyboard?
@Fullstack Development ...I've been getting error - Expected an assignment or function call and instead saw an expression no-unused-expressions..could you please help with it
Have you writen the return method correctly? I had same error once and the cause was return function.
it's working when i use the api in the video, but when i use my api which is in the localhost it doesn't function do u have any idea?
Thank you sooo sook much for this, but how can i do this with function component?
Hi, First of all, Thank you for all these informative videos.
I just want to ask you for a devise, I want to start learning React Native, So what's the RoadMap you are recommended to follow until I will be able to do a complete task from zero,
Also, can I working as a full time freelancer using it to built app , because in my country there is few to nothing jobs in this field.
I will be more than thankful for your answer and time (:
Hi thanks! I just launched a forum for this channel where you can get more answers from other people and discuss your questions: fullstackdiscussion.com/. I try to respond to as many questions as possible but there are just too many at the moment as the channel is growing quickly.
how to use for loop and dispaly only few names
could someone tell me how to retrieve data from edamam? there's plenty of tutorials on the 1st version but they've updated v2 and I can't get my head around it please help!
How can we fetch data or table from sql server database to react application
Error: Unexpected token < in JSON at position 0 - - The file that contains data is an XML
Plz help
change script type to "text/babel"
Tks you very much !
You are welcome!
How to set the api key on get method ?
thank you ver much
is there a part 2? how do you access the address details?
What if I want to display one user from the array instead of listing everything?
You can use array filter() method to specify the condition.
How I can transfer that data in table?
But actually how the front end knows that url. I mean when he is building his app how can he knows actually the url that he should be using to fetch data.
Does the back end built before the front end so the back end tell the front end what are the URLs that he should be fetching to get the data from.
Or what's the case
Please help me guys I'm little confused
Back-end trainee here.
Come to see how do you use my apis
Nice!
thank you so much
You are welcome!
thank you
I am getting items.map is not a function error
i'm getting an error: TypeError: items.map is not a function
my "isLoaded" variable is always undefined, anybody has the same issue?
I keep getting items.map is not a function, is this not how you do it anymore in React?
maybe your api is not providing list of object diectly. So if there is any key in api where u r storing those object use that to access ex this.setState({data: json.list,isLoaded : true})
how to get array data from api as list?
Thanks! And how to do it in separate component and send data here?
pass jason as props? does that work? I'm also learning so I'm only trying to firgure it out.
TypeError: items.map is not a function
sam yoyo its no deal of this video. Its just about fetching data from api. You can use 'for' cycle instead. Or just display few items from items list, smths like
{items[0].name}
{items[1].name}
{items[2].name}
Every else nuances its just pure JS, but in this video author covered actually retrieving data from api.
If you get .map is not a function, try adding the initial key name between data.map "data.keyname.map"
how pls
@@okoyechiamaka4103 you're data will have a key value pair. Data.map can change depending on what your data is called. Try some different combos.
Can you show me what it should look like
Provide the structure of your json
I like this video
I like you
really nice content .....
how can I put api key in this code? like google places needs api key...
best video
Thanks!