Тёмный

Using Fetch API in React to populate NewsItems | Complete React Course in Hindi #27 

CodeWithHarry
Подписаться 7 млн
Просмотров 250 тыс.
50% 1

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 556   
@CodeWithHarry
@CodeWithHarry 3 года назад
Playlist access kar lena: ru-vid.com/group/PLu0W_9lII9agx66oZnT6IyhcMIbUMNMdt If you are on Instagram, you can follow me there for more updates on courses & other stuff: Instagram.com/codewithharry
@adarshjaiswal2312
@adarshjaiswal2312 2 года назад
hi harry where we can get full code
@REXWILLRISE831
@REXWILLRISE831 6 месяцев назад
@@adarshjaiswal2312 plz batao harry bhai
@TareerMustafa
@TareerMustafa 2 месяца назад
Haris Bhai CompTIA A+ CompTIA security+ CEH pr networking pr videos banaden
@shashwatagrawal8412
@shashwatagrawal8412 3 года назад
Maza aagya bhai... Can't tell how blessed I feel to have discovered your course and also your channel. :)
@FarhanAhmad-ll5fn
@FarhanAhmad-ll5fn 2 года назад
fetch is not working please help me
@rinkuverma5093
@rinkuverma5093 Год назад
www.youtube.com/@advanceduitechniques516
@rupalsaxena9837
@rupalsaxena9837 Год назад
@@FarhanAhmad-ll5fn same
@maneetkaur4214
@maneetkaur4214 2 года назад
When I was following the code by Harry Bhai there got an error when fetching the data from the API. this is what I did to resolve the error (I guess this would work for you ) : async componentDidMount(){ try{ const res = await fetch(url); const data = await res.json(); this.setState({ articles: data.articles }); } catch(e) { console.log("something is not working"); } } PS. You can use axios too
@abhishek_rathod
@abhishek_rathod 2 года назад
Thank you brother it helps.
@drowning-Monkey
@drowning-Monkey 2 года назад
Thanks brother i was struggling with this error for 2-3 hours now it's working.... 👍
@harshitsz8144
@harshitsz8144 2 года назад
thanks, it worked
@nitishsrivastava571
@nitishsrivastava571 2 года назад
Thanks bro Its very helpfulful for me.
@TheSachinkk
@TheSachinkk 2 года назад
Working...Thank a lot
@faizshaikh5092
@faizshaikh5092 2 года назад
Hello, Harry Bhai! You can use below code for adding three dots to title and description of news: style={{maxWidth: '100%', display: '-webkit-box', WebkitBoxOrient: 'vertical', WebkitLineClamp: 2, overflow: 'hidden', textOverflow: 'ellipsis'}} Thank you! Love from solapur
@kamalpurohit7158
@kamalpurohit7158 Год назад
are bro direct jake text-truncate class use kro na khel khatam
@kamalpurohit7158
@kamalpurohit7158 Год назад
bootstrap class h text-truncate u can see
@rinkuverma5093
@rinkuverma5093 Год назад
www.youtube.com/@advanceduitechniques516
@thecosmetrohub2737
@thecosmetrohub2737 Год назад
@@kamalpurohit7158 but i am not getting 3 dots at end
@braveviewing3830
@braveviewing3830 Год назад
@@thecosmetrohub2737 use text-truncate inside tags of NewsItem component where you defined title and description and it will work
@SinmbfLost
@SinmbfLost Год назад
If you want to make all the cards to equal height then follow this: In the div with className="card" , add a class called "h-100". Now every card should be of same height but the buttons are not aligned properly due to the difference in content of the different cards. To fix this, in the div with className="card-body", add classes "d-flex flex-column". Then finally, in the read more button add a class "mt-auto". This should make every card equal height and make them look better. If any problems, feel free to ask :)
@ummi7292
@ummi7292 6 месяцев назад
Hi ..could you plz let me know why the fetch api was used in componentDidMount() and not in the constructor(). I understand it means the fetch API happens after rendering but my question is "why"? Why can't it happen at the very outset ?
@ahmadrasheed2598
@ahmadrasheed2598 Месяц назад
@@ummi7292 Because you cannot make a constructor async in JavaScript. if we use fetch() API without async and await then it will asign value to data variable as a pending promise (it will assign varaible first because of Asynchronous nature of JS )
@anantdhiman4189
@anantdhiman4189 3 года назад
i recently start following this course and i am loving it, thank you so much while learning "fetch" i was getting this error "TypeError: Cannot read properties of undefined (reading 'map')" From reactjs Docs - this is what i found and works for me, may be it helps other too fetch(url).then((res) => res.json()) .then((json) => { this.setState({ articles: json.articles, loading: false }); })
@rushikeshsaraf6219
@rushikeshsaraf6219 3 года назад
bro after one hour finally i got solution
@rushikeshsaraf6219
@rushikeshsaraf6219 3 года назад
Update ur constructor like this : constructor() { super(); this.state = { articles : [], loading : false } }
@anantdhiman4189
@anantdhiman4189 2 года назад
Thank you @rushikesh I did realised, I didn’t use await :)
@anjanisharma9509
@anjanisharma9509 2 года назад
@@anantdhiman4189 yes
@fantasycube2482
@fantasycube2482 2 года назад
@@rushikeshsaraf6219 thank you so much you make life life ! other wise i am looking length and array
@nothingmuch9346
@nothingmuch9346 3 года назад
Class 9 me hun phir bhi Harry bhai ka ds algo smjh gya itna accha explained hain
@Motivational_videos84k
@Motivational_videos84k 8 месяцев назад
Aanand aa raha h Harry bhaii♥
@ajayarya1193
@ajayarya1193 Год назад
Hello, buddy, if you're also get stuck with same problem I had been, just paste it async componentDidMount() { fetch("url").then((response) => response.json()) .then((data) => { this.setState({ articles: data.articles }); }); }, If anyone can explain me why the old one did not work please help me out.
@nishantchaudhary6240
@nishantchaudhary6240 Год назад
you are life saver
@gopalsharma9364
@gopalsharma9364 Год назад
Dil se sukriya bhai❤
@pooja6380
@pooja6380 Год назад
thank you i was stuck here from 2 days
@sehajdeepsingh7427
@sehajdeepsingh7427 Год назад
Hii, i am still stuck with not getting any news from api show on the browser. I can see thtat the api is working as I can see the result in console tab, but not on the web page. No error is displaying as well
@sehajdeepsingh7427
@sehajdeepsingh7427 Год назад
Hii, i am still stuck with not getting any news from api show on the browser. I can see thtat the api is working as I can see the result in console tab, but not on the web page. No error is displaying as well
@ashishvispute2715
@ashishvispute2715 Год назад
for those whose componentDidMount is not working i found this syntax and it worked for me here is my News.Js file import React, { Component } from 'react' import NeswItem from './NewsItem' export class News extends Component { constructor(){ super(); this.state={ data : null, loading : false } } componentDidMount(){ let url = //your url fetch(url).then((res)=>{ res.json().then((result)=>{ console.log(result.articles) this.setState({data:result.articles}) }) }) } render() { return ( Top Headlines {this.state.data ? this.state.data.map((element)=> ) : null } ) } } export default News
@prateekverma1381
@prateekverma1381 Год назад
it worked .thanks
@o78-neerajmehta99
@o78-neerajmehta99 Год назад
thanx brother
@vinniverma469
@vinniverma469 Год назад
ab sirf navbar and heading show ho rhi hey baki kuch na show ho raha
@todaysindia4114
@todaysindia4114 Год назад
thank you
@durgarajvansh
@durgarajvansh Год назад
You are life saver
@MensAttitude
@MensAttitude 6 месяцев назад
If render is called before the componentdidmount, then how articles is being displayed on the page. Because page will be rendered first, and after rendering the page component did mount will be called where we are fetching the data from API?
@chandreshsolanki7580
@chandreshsolanki7580 4 месяца назад
I think that's why he used async await function which stops all other function and fetch data and then render so using async function it will wait for fetching and then render page
@ashishrao4273
@ashishrao4273 2 месяца назад
I implemented the same and I’m facing the same issue
@AmitKumar-xx7zj
@AmitKumar-xx7zj Год назад
Thank you Harry bhai for such an awesome course
@CodeWhy
@CodeWhy 3 года назад
@codewithharry you are my favourite youtuber. Love you bro☺️☺️☺️☺️
@shi-nee7966
@shi-nee7966 3 года назад
For the algorithem. Altho i bought a course on udemy before this course started but i know harry bhai's the best. So im liking and commenting on every video for the algo.
@Armaan-yv1se
@Armaan-yv1se 4 месяца назад
My headlines are not getting populated on browser and there's no issue in compilation and it's not showing any error.. How to resolve it???
@mohituniyal7
@mohituniyal7 3 года назад
I would comment in every video till you don't reply. I am really thankful to you. I didn't have cs in 12th but learned programming c and CPP from your videos and still learning. Moreover, I got a confidence boost. Once again thank you for your efforts.
@allaeibgaming2164
@allaeibgaming2164 3 года назад
Please continue your machine learning course
@ashishrao4273
@ashishrao4273 2 месяца назад
Constructor Render Component did mount That’s the reason it’s not displaying in browser and if you map in component did mount and you can see the output.
@tejaskumar4470
@tejaskumar4470 3 года назад
Wow!!!! 🔥🔥 Harry Bhai 😀
@itsmytechnology9285
@itsmytechnology9285 3 года назад
Harry Bhai OP!!!! 🔥😊
@framed5893
@framed5893 Год назад
If someone is getting error "Cannot read properties of undefined (reading 'map')" then use this this.state.articles && this.state.articles.map((element) ....
@avadhut9017
@avadhut9017 Год назад
Can you explain me
@framed5893
@framed5893 Год назад
@@avadhut9017 It checks whether the array is NULL or not, if it is null then (i.e it will check this.state.articles is NULL or not ), if it is null then it will not run the code. We have to do this because if it is null then .map function will throw error.
@Ashwani_sharma
@Ashwani_sharma Год назад
​@@framed5893sir ,I tried this but card item is not showing
@TabassumSiddiqui-s8o
@TabassumSiddiqui-s8o 11 месяцев назад
Check if you added () after json like data.json();
@IKnowYourSecret989
@IKnowYourSecret989 11 месяцев назад
After 2h of struggle I found out I have a spelling mistake, (articles -> articels) 🌚
@samuelfrank1369
@samuelfrank1369 22 дня назад
Thanks a lot #HarryBhai
@brijeshtelecombusiness
@brijeshtelecombusiness 3 года назад
Sir Multi Recharge Software development ke baare me bhi kuchh bataye
@sarasazad9174
@sarasazad9174 3 месяца назад
Anand aa rha hai Hary bhai! Excellent you are
@abhayvis
@abhayvis 3 года назад
Harry is on fire 🔥
@tajinder715
@tajinder715 Год назад
it is no harm pay no attention to it
@lavanyabisht5984
@lavanyabisht5984 6 месяцев назад
I am having a problem during console log after running constructor render cdn again render is running why if you know the problem help out
@allaeibgaming2164
@allaeibgaming2164 3 года назад
Please make course on machine learning
@khuzaimaamir8458
@khuzaimaamir8458 Год назад
if anybody having error for undefined:state Simply add this to componentDidMount : .then(response => response.json()) .then(data => this.setState({ articles: data, loading: false }));
@rahulvishwakarma9640
@rahulvishwakarma9640 Год назад
Bro please can you send the full code pls i am facing this error from last two days
@khuzaimaamir8458
@khuzaimaamir8458 Год назад
@@rahulvishwakarma9640 send me your number
@rupalsaxena9837
@rupalsaxena9837 Год назад
same question...can you paste your code here
@HariomSingh-ei4fb
@HariomSingh-ei4fb 2 года назад
This video series is very very helpful and interesting Thanks alot Harry bhaiii♥️
@rahulmaurya2558
@rahulmaurya2558 2 года назад
I'm totally getting blank page after writing all the codes and in the console its showing the 20 objects I don't know where is the error?
@pratikkadale_171
@pratikkadale_171 Год назад
harry bhai koi effective way nahi hai kya API se data fetch karne ke liye? ....becauce everytime we click next ...it again request the api........jisse apne request waste ho rahe hai...... there should be a way jisse app ek sath hi sab page load kar lo ..then after usse page mai seprate kar lo........
@anujpalkic
@anujpalkic Год назад
data are not coming in card which we used to populate the news items please help me
@psychoticgamer6853
@psychoticgamer6853 3 года назад
Make a tutorial on how to integrate react with django
@aayushsingh74
@aayushsingh74 Год назад
harry bhai 7:47 hum element.title && element.title.slice(); and same for description also bhi use kr skte hai nah maine wahi kiya tha aur usse thik hogya tha.....
@Amal-qh3uu
@Amal-qh3uu 3 года назад
Harry bhai on fire !!
@loveleensingh1805
@loveleensingh1805 Год назад
Your explanation is awsome you are my inspiration
@piyushbora4763
@piyushbora4763 2 года назад
Hello Harry Bhai! Why didn't all the articles get displayed in this page only?
@prajedits4065
@prajedits4065 Год назад
Done with #27 Thank YOU!! 🥳
@gopal12455
@gopal12455 2 года назад
this tutorial is usefull
@Shoping_YT
@Shoping_YT 3 месяца назад
Anand Aa Rha Hai
@2ik834
@2ik834 3 месяца назад
can you please make a video on Yelp API...
@PrabinManandhar-y5l
@PrabinManandhar-y5l 6 месяцев назад
hey harry one question, first the constructor is called then render is called and only then componentdidmount is called which brings the data. if render is called before componentdidmount, then how is the fetched data rendered and shown to our page
@chandreshsolanki7580
@chandreshsolanki7580 5 месяцев назад
I think because he used asyn await so the execution of another function stopped and first componentdidmount called and then render
@delhiwarriorgaming2882
@delhiwarriorgaming2882 2 месяца назад
componentdidmount function re-renders the page immediatly after changing the state..thus first constructor then render then componentdidmount then render again..
@AMITKUMAR-np7el
@AMITKUMAR-np7el 2 года назад
i recently start following this course and i am loving it, thank you so much while learning "fetch" i was getting this error "TypeError: Cannot read properties of undefined (reading 'map')" I have used below code in constructor and its working fine.... constructor() { super(); console.log("This is constructor") this.state = { articles: [], loading: false } }
@abhishekbiranje4533
@abhishekbiranje4533 2 года назад
update your code instead using this.setState({articles:parsedData.articles}) you can use this.setState(this.articles=parsedData.articles) and also cannot remove the articles array that you already initialize in the first place.
@anishgoyal4424
@anishgoyal4424 2 года назад
@@abhishekbiranje4533 Hey dude this is not working , it shows a "," missing error
@abhishekbiranje4533
@abhishekbiranje4533 2 года назад
​@@anishgoyal4424 sorry my mistake use = in setState(this.articles = parsedData.articles),this will work
@anishgoyal4424
@anishgoyal4424 2 года назад
@@abhishekbiranje4533 thanks
@rahulmaurya2558
@rahulmaurya2558 2 года назад
@@abhishekbiranje4533 you are telling use = in setState but where ? i got confused
@lavanyashivu6125
@lavanyashivu6125 3 года назад
Pls do make Redux series also 🙏
@ArunKumar-jg8gx
@ArunKumar-jg8gx Год назад
East or west Harry Bhaiya Best 🔥😍
@babunapati8630
@babunapati8630 2 года назад
while using fetch api ive been detected with this error messgae on console page " Uncaught (in promise) SyntaxError: Unexpected token '
@rajatchaurasia3578
@rajatchaurasia3578 3 года назад
Fully Sunday gride 🔥🔥🔥
@AsyncGaming
@AsyncGaming 3 года назад
Bhai aaj toh aapne mauj kardi ek ke baad ek videos♥️♥️
@FarhanAhmad-ll5fn
@FarhanAhmad-ll5fn 2 года назад
fetch is not working please help me
@rakeshkushwah7559
@rakeshkushwah7559 2 года назад
Cannot read properties of null(reading 'articles') What can be the error I'm stuck on this error 🥺
@KCODivyanshuKatyan
@KCODivyanshuKatyan 2 года назад
Same
@deeptidip9864
@deeptidip9864 Год назад
Same. Did you find any solution
@narasimha6470
@narasimha6470 Год назад
Incase If your articles is fetching and showing in console but not rendering in page, use this.state.articles in map function
@sheikhmuzamil7218
@sheikhmuzamil7218 Год назад
facing same issue.. can you tell breifly
@narasimha6470
@narasimha6470 Год назад
@@sheikhmuzamil7218 async componentDidMount(){ const res = await fetch(url); const data = await res.json(); //Here I used this.setstate we must use this.articles.setstate// this.articles.setState({ articles: data.articles }); }
@sehajdeepsingh7427
@sehajdeepsingh7427 Год назад
@@narasimha6470 The browser is saying that this.articles.setState is not a function
@narasimha6470
@narasimha6470 Год назад
@@sehajdeepsingh7427 may be spelling Mistake of setState
@sehajdeepsingh7427
@sehajdeepsingh7427 Год назад
@@narasimha6470 is this correct written in error code? this.articles.setState is not a function
@thecodingdice3107
@thecodingdice3107 2 года назад
I have an error when mapping parseData this is how i resolved the error this.state.article?.map((element) => console.log(element)) we have to write an extra question mark in state.article🧐🧐
@santy-vlogs
@santy-vlogs Год назад
This solved my error of reading map, thanks and it was helpful
@mohitagrawal7925
@mohitagrawal7925 7 месяцев назад
@@santy-vlogs bro i solve the error but its not fetching the headings its just blank space below heading "Headlins"...what should i do
@abhisekchowdhury8584
@abhisekchowdhury8584 3 года назад
Harri please show some examples --- how to use POST parameters with json body in Fetch APIs ?
@FarhanAhmad-ll5fn
@FarhanAhmad-ll5fn 2 года назад
fetch is not working please help me
@mountain_and_me
@mountain_and_me Год назад
Error : When i click on next button it show me blank page error ( Cannot read properties of undefined(reading 'map')....... Help please 🙏
@ManjotSingh-sf5qn
@ManjotSingh-sf5qn Год назад
Hey I'm facing the same problem did you found the solution yet?
@getknowledgebite3413
@getknowledgebite3413 2 года назад
DidMount ko thoro explain bhi kar dete kya hua iss code m sbb upper se gya sir
@factor5902
@factor5902 3 года назад
Consistency × 100😌
@princejain2851
@princejain2851 3 года назад
bhai angular pr bhi ek full tutorial bhi bnao.usme kaafi problem aati h
@dakshkumar3690
@dakshkumar3690 3 года назад
you are a legend bro your explanation is awsome you are my inspiration
@FarhanAhmad-ll5fn
@FarhanAhmad-ll5fn 2 года назад
fetch is not working please help me
@ManojKumar-ul1qp
@ManojKumar-ul1qp Год назад
Harry bhai sahi mein maza agaya. You are the best teacher and I like your voice very much ❤️
@rupalsaxena9837
@rupalsaxena9837 Год назад
Could you help me why fetch is not working?
@aryan7069_
@aryan7069_ 3 года назад
logic ne harry bhai ka dimaag lelia
@anshumankhuntia8683
@anshumankhuntia8683 2 года назад
can not read property of undefined (reading 'map') in using fetch Api [react-vdo-27] cant solve....... please help @harrySir
@safanvhora4970
@safanvhora4970 Год назад
I have an error when mapping parseData this is how i resolved the error this.state.article?.map((element) => console.log(element)) we have to write an extra question mark in state.article
@computermaster3786
@computermaster3786 Год назад
@@safanvhora4970 please reply me bro it solves the map function error but it doesn't rander data in card please help me I am stuck on this error from previous 4 days please help
@ASShaikh-x5r
@ASShaikh-x5r 2 месяца назад
Maza aa gya bhaai....
@SlickStatus
@SlickStatus 2 года назад
Bahot Sahi 💥
@aymandin4912
@aymandin4912 3 года назад
My future job is depending on you harry bhai... Thanks a lot!
@FarhanAhmad-ll5fn
@FarhanAhmad-ll5fn 2 года назад
fetch is not working please help me
@sujitcodes
@sujitcodes 2 года назад
@@FarhanAhmad-ll5fn same problem, not able to update the articles data using useState()
@harshsingh7713
@harshsingh7713 3 года назад
Bhaiya mera JEE Ka paper khtm hogya h Mai coding sikhna chahta hu pr mujhe kuch pta nhi h kha se Start kru please give me suggestions 🙏
@psychoticgamer6853
@psychoticgamer6853 3 года назад
Angaar... 🔥🚀
@dipusah9795
@dipusah9795 2 года назад
koi dikkat wali bat nahi hai harry vai
@AbhinavSingh-uw6hh
@AbhinavSingh-uw6hh Год назад
I have a doubt? Why we are changing articles in componentDidMount() and not in constructor() ?
@rupalsaxena9837
@rupalsaxena9837 Год назад
Hey could you help me why fetch is not working?
@AbhinavSingh-uw6hh
@AbhinavSingh-uw6hh Год назад
@@rupalsaxena9837 yeah sure. send me the code
@rupalsaxena9837
@rupalsaxena9837 Год назад
@@AbhinavSingh-uw6hh import react, { Component } from "react"; import NewsSite from "./NewsSite"; export default class News extends Component { constructor() { super(); this.state = { articles: [], loading: false }; } async componentDidMount() { let url = "newsapi.org/v2/top-headlines?country=in&apiKey=7c7a544807b344a8be4cf266f97ca5ca"; let data = await fetch(url); let parsedata = await data.json(); console.log(parsedata); this.setState({ articles: parsedata.articles }); } render() { return ( NewsMonekey {this.articles.map((element) => { console.log(element.description); return ( ); })} ); } }
@furygaming5321
@furygaming5321 3 года назад
map function error aarha h sir ?? what to do
@rhs1078
@rhs1078 2 месяца назад
Amazing work #harryBhai
@adityanawale2634
@adityanawale2634 2 года назад
Is there any alternative of apis that can be used for deployment part
@AnuragKumar-zx7ew
@AnuragKumar-zx7ew Год назад
Friends, if your data is not fetched using API , then you can change your default browser from Chrome to Microsoft edge, this may fetch data, as I was struggling for 3days, and when I change the default browser it suddenly loded all the news
@nextleveltech267
@nextleveltech267 Год назад
Thank you ❤️
@lavanyashivu6125
@lavanyashivu6125 3 года назад
Hi pls do make Angular series with crud operations and jwt authentication and pls build a complete MEAN and MERN app
@Gaurav_Nahata
@Gaurav_Nahata 3 года назад
brother you are doing a gr8 work . can u please teach me how to create an array in java
@supratim08
@supratim08 3 года назад
int [] arr={1,2,3,4,5} another way is by mentioning the size--> int [] arr= new int[4]; arr[0]=1; arr[1]=2; .. and do check the java playlist for detail.
@ShubhamVerma-hw4uj
@ShubhamVerma-hw4uj 3 года назад
bhai java ka poora course bna rkha h bhai ne
@Gaurav_Nahata
@Gaurav_Nahata 3 года назад
@@supratim08 tnx
@rittwickbhabak7348
@rittwickbhabak7348 2 года назад
This react js couse is very helpful. Awesome teaching style.
@FarhanAhmad-ll5fn
@FarhanAhmad-ll5fn 2 года назад
fetch is not working please help me
@rittwickbhabak7348
@rittwickbhabak7348 2 года назад
@@FarhanAhmad-ll5fn there may a lot of reasons, it is impossible to track it without seeing the actual code, you may paste the errors here, we can see it. One possible reason may by, you are not using localhost:3000, instead you are using 198.162.xx.xx ip address, using ip address will not work, instead open the localhost link, other possible reason may be the wrong apikey, or a expired api key.
@FarhanAhmad-ll5fn
@FarhanAhmad-ll5fn 2 года назад
can you give me your mail so i send you pictures of output and code
@rishibethi2722
@rishibethi2722 9 месяцев назад
What to do if the image is not NULL and its "404 Image Not Found" , what if case should i write to tackle it.....ANY IDEAS ARE ACCEPTED.
@santy-vlogs
@santy-vlogs Год назад
whoever getting error like this "TypeError: Cannot read properties of undefined (reading 'map')" please try this solution , change fetch(url) to fetch(url).then((res) => res.json()) .then((json) => { this.setState({ articles: json.articles, loading: false }); }); it should work
@AnuragKumar-zx7ew
@AnuragKumar-zx7ew Год назад
bro can you please send your code , as I am struggling from 3 days, but till now I am getting same error
@bansitapatra9765
@bansitapatra9765 Год назад
thank you
@rajbannasa7662
@rajbannasa7662 2 года назад
Thank you so much sir ❤️
@farhanakhtar5229
@farhanakhtar5229 2 года назад
harry bhai yrr app bohot jaldi hi karte ho thoda aram se btaya kariya ke componentdidmount kya karta he await ka use kyo kiyayrr kuch samjh nhi aya
@ravipanchal34
@ravipanchal34 Год назад
i am facing this error - {Uncaught (in promise) TypeError: this.setstate is not a function at News.componentDidMount}
@foodienationn
@foodienationn Год назад
make it this.setState instead of this.setstate e.g this.setState({articles: parsedData.articles}) ;
@samking618
@samking618 Год назад
@@foodienationn thanks alot, can you explain why it worked for Harry though?
@foodienationn
@foodienationn Год назад
@@samking618 welcome 😇
@Victor-ev3vu
@Victor-ev3vu 3 года назад
3 videos under 2 hours
@sumittanwar8389
@sumittanwar8389 2 года назад
Why I am getting uncaught TypeError : " Cannot read properties of undefined (reading 'map') " In News.js Nothing is showing on page. Please help me. If anyone of you getting the same error 😔😔
@rahulprajapati8052
@rahulprajapati8052 2 года назад
you must be used parsedData instead of parsedData.articles . Hope this might help this.setState({ articles: parsedData.articles, loading: false, });
@sumittanwar8389
@sumittanwar8389 2 года назад
@@rahulprajapati8052 thanks bro 😊
@Stocklance
@Stocklance 2 года назад
@@rahulprajapati8052 Bhai mera abhi bhi nhi aa rha same error hai... Please Help
@safanvhora4970
@safanvhora4970 Год назад
I have an error when mapping parseData this is how i resolved the error this.state.article?.map((element) => console.log(element)) we have to write an extra question mark in state.article
@computermaster3786
@computermaster3786 Год назад
@@safanvhora4970 yr es say json ka data render nahi hota card may what is the problem I am stuck from previous one week
@Skm-mq1sw
@Skm-mq1sw 3 года назад
Harry Bhaiya categories wise news fetch kijiye
@Skm-mq1sw
@Skm-mq1sw 3 года назад
Means that sports news ko sport category me
@lavanyashivu6125
@lavanyashivu6125 3 года назад
Awesome series
@kingsukrudra2997
@kingsukrudra2997 3 года назад
Thank you via
@monoj9
@monoj9 Год назад
Is there a way to filter news without an imageurl. Like to ignore, if the article doesnt have an image url. And show only does having a image url. Please help.
@only_friendship1272
@only_friendship1272 2 года назад
bro source code kha he
@SakshamVedi
@SakshamVedi 2 года назад
harry bhauuu u are star
@VANSHDUTTPATHAK
@VANSHDUTTPATHAK 3 года назад
make a full course on Kali Linux
@aishwarpathak509
@aishwarpathak509 Год назад
i'm getting ERROR in [eslint] src\components\News.js Line 71:3: Parsing error: Unexpected token (71:3) webpack compiled with 2 errors and 1 warning please help me rectify it
@sachinverma3925
@sachinverma3925 2 года назад
full majaaa aaa rha Harry bhai❤❤❤❤❤✌✌
@FarhanAhmad-ll5fn
@FarhanAhmad-ll5fn 2 года назад
fetch is not working please help me
@somethingdifferent3774
@somethingdifferent3774 Год назад
Yess mza aaya ❤❤
@udaythapar4237
@udaythapar4237 2 года назад
Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'map')
@suber-iq9187
@suber-iq9187 2 года назад
yes me
@safanvhora4970
@safanvhora4970 Год назад
I have an error when mapping parseData this is how i resolved the error this.state.article?.map((element) => console.log(element)) we have to write an extra question mark in state.article
@safanvhora4970
@safanvhora4970 Год назад
TypeError: Cannot read properties of undefined (reading 'map') i am getting this error after that slice error and i can't solve it can please anybody help
@computermaster3786
@computermaster3786 Год назад
Same problem how can they place data in empty array the article arrays are empty this is the typeerror my api fetching data in console but not displaying in article array
@rahulvishwakarma9640
@rahulvishwakarma9640 Год назад
​@@computermaster3786 Same here how can we solve this problem?
@computermaster3786
@computermaster3786 Год назад
@@rahulvishwakarma9640 bro check the article spell which comes in API and you
@ikbalbodila4148
@ikbalbodila4148 3 года назад
Hello Harry Bhai, I am in diploma, I want to buy a laptop, which processor is better for diploma and Degree of Information technology ? intel i-3 or intel i-5 ? ryzen-3 or ryzen-5 ? Please reply me....
@deepgojariya4272
@deepgojariya4272 2 года назад
Harry bhai mere console mai articles data aa raha hai but webpage par nahi dikh raha. I also updated it using setState
@programminginhand4453
@programminginhand4453 2 года назад
am facing same issue
@kapilgera8239
@kapilgera8239 2 года назад
facing the same issue let me know if you got it fixed
@ibrahimafzan5408
@ibrahimafzan5408 Год назад
Change this.State to this.state "s" should be in lower case
@safanvhora4970
@safanvhora4970 Год назад
@@ibrahimafzan5408 not working bro
@safanvhora4970
@safanvhora4970 Год назад
i spelled the article spelling wrong i corrected it and it worked
@hasan_0.0.7
@hasan_0.0.7 Год назад
#HarryBhai, Harry Bhai, big fan. But I have a question, what is promise? I think I have missed this part. Can you please tell me in which video have you discussed about it?
@zakirehman4130
@zakirehman4130 Год назад
Mr Harry ek masla hai mere kuch news cards pay image abi bhi display nai hooa aur request timed out ka error show kr raha hai console main to wo kesay resolve ho ga?
@fahadjawad5235
@fahadjawad5235 2 года назад
Harry bhai componentDidMount error dy raha hai missing semicolon ka any suggession?
@itsmee8303
@itsmee8303 2 года назад
News.js:98 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map') I am getting this error. How to resolve it ?
@aayushsharma9386
@aayushsharma9386 2 года назад
let parsedData = await data.json(); Make this change in ComponentdidMount function. It should work.
@arhabumer
@arhabumer 2 года назад
@@aayushsharma9386 is sy bhi nhi chal rha kia karo batao ap??
@aayushsharma9386
@aayushsharma9386 2 года назад
@@arhabumer are you still getting same error ? Try using a try catch block here
@arhabumer
@arhabumer 2 года назад
@@aayushsharma9386 thank you so much for your help but I have shifted to functional
@safanvhora4970
@safanvhora4970 Год назад
I have an error when mapping parseData this is how i resolved the error this.state.article?.map((element) => console.log(element)) we have to write an extra question mark in state.article
@anujpalkic
@anujpalkic Год назад
data are not coming in card which we used to populate the news items please help me data are not coming in card which we used to populate the news items please help me data show in console but not show in cart
@Ashwani_sharma
@Ashwani_sharma Год назад
Any solution??
Далее
Blue vs Green Emoji Eating Challenge
00:33
Просмотров 3,3 млн
КОТЯТА НАУЧИЛИСЬ ГОВОРИТЬ#cat
00:13
How Many Twins Can You Spot?
00:17
Просмотров 23 млн
What is an API?
12:36
Просмотров 1,7 млн
Fetching Data in React - Complete Tutorial
29:10
Просмотров 126 тыс.
Context API in react | get the concept
29:00
Просмотров 60 тыс.