You can use "condition && code to execute" instead of ternary operator with null for false like in "posts.length ? code : null" and errorMsg ? code : null
nice today i came across another great react teacher who has solved my doubts .... subscribed as well as liked and has also shared it with my fellow dev friends
while making get request using axios, it shows error " No 'Access-Control-Allow-Origin' header is present on the requested resource.". I solved this by adding CORS extension in firefox but this is not a good option to do it.
This is due a cross origin server problem. When you access from a front-end server like localhost:3000 to a back end server like localhost:8080, the server tells you are trying to access to 8080 from a different server and it blocks your request. You have to configure what front end servers are allowed on your backend server.
Can anyone please help me how to get single data from get request Means /posts/1 where 1 can be 2 3 ... passing a variable and works according to the id ?? Please help me I am in real trouble I need to submit my project this week
@Borisov Alexander For making a scroll effect... on the first page only 10 should appear, then while scrolling to the bottom page the next 10 should appear.. as like our Facebook notifications page
@@kushagragupta4363 ha 9 months ago I was a complete beginner. Now after all these months. I never class based component in any of my projects. But it's a good thing to know!
@@kushagragupta4363 if your a beginner do some api fetching projects like use a any movie api and make a project on that. Or make a expense tracker or a basic to-do list. In general any project by utilizing am external public api
posts array contains an array of objects so u can simply access any one of them by its id as there is an id property in each objects .. just use map method to loop through each item and return it if its id matches with ur desired id and break the loop ..is there any other method pls let me know ..
in the index.js file, it has an option for development that says something like you have to choose another mode, because in this mode, it renders all twice, but it does make anything fail, if you wanna know.
JUST KNOW IT!!!
You're freaking mind-blowing and genius my man!
Like your videos, I so love when a teacher provides summary of what he has discussed. Thanks!
me too . It helps a lot
These videos have been so helpful, I cannot thank you enough Vishvas!
Best tutorial always on the point and gives clear explanation
You can use "condition && code to execute"
instead of ternary operator with null for false
like in "posts.length ? code : null"
and errorMsg ? code : null
That's lean and nice
nice today i came across another great react teacher who has solved my doubts .... subscribed as well as liked and has also shared it with my fellow dev friends
this is amazing!! helped me so much
Excellent video sir! Thank you
Thank you vishwas
God bless you richly. You have helped me and my career. Thank you very much
You are welcome :)
Module not found: Can't resolve 'axios' in 'D:
eact\hello-world\src' i am getting this error
the variable name 'posts' and variable in constructor state 'posts' .. do both names should be same ? more over errorMsg also ?
i got an error:"Unhandled Rejection (TypeError): Cannot read property 'catch' of undefined"
the best , thanks for this video
Thanks for the video! it is very helpful!
It through as an error - TypeError: cannot read property 'length ' of undefined , how to resolve it
write posts && posts.length ? instead of just posts.length as it will also validate that number of posts are defined or not
@@umedsingh8437 thanx brother but why can you explain please..??
Very Helpful Video
while making get request using axios, it shows error " No 'Access-Control-Allow-Origin' header is present on the requested resource.". I solved this by adding CORS extension in firefox but this is not a good option to do it.
hi, try this:
get.(url, { 'headers' : { 'Access-Control-Allow-Origin' : '*'}})
This is due a cross origin server problem. When you access from a front-end server like localhost:3000 to a back end server like localhost:8080, the server tells you are trying to access to 8080 from a different server and it blocks your request.
You have to configure what front end servers are allowed on your backend server.
If your backend is written in nodeJS then use CORS middle ware to solve this iusse.
app.use(cors()).
@codevolution - Is there a tutorial for creating an API instead of using it?
Hey man, why are you not using functions instead of classes?
Superb ...........!!!👌👌👌👌👌👌👌👌👌👌👌👌👌
TypeError: Cannot read property 'length' of undefined
Please provide more info about your error
Can anyone please help me how to get single data from get request
Means /posts/1 where 1 can be 2 3 ... passing a variable and works according to the id ??
Please help me I am in real trouble I need to submit my project this week
Thank you
How do you render nested arrays though?
Thx !!! Great explanation !!!
Awesome..., Thank you
I just wanted to know where "react routers" has been covered?
bcuz, react router is not part of react. its external
Thank you too much
u r awesome Man
nice videos it is very useful for me
Awesome
Just wonder can we use componentWillMount instead componentDidMount, so that it doesn't have to rerender bcs the state is changed?
componentWillMount() ,This is not a safe method according to the official reactjs documentation
@@chirashankar4495 can u refer it to me pls?
Hi there! how could i add the rce to create classes faster? Mi visual studio code doesn't have it
go to settings and choose extensions in it and type ES7 and that snippet to it. Enjoy using s
snippets
Go to Extension Tab and Install ES7 React, Readux,GraphQL Snippets
how to limit the API call? like per call first 10 then for the next call the next 10 and finally call should stop after completion.
@Borisov Alexander For making a scroll effect... on the first page only 10 should appear, then while scrolling to the bottom page the next 10 should appear.. as like our Facebook notifications page
5:55 Summary
Sir, is the super keyword deprecated now ? cause in VS Code,it gives a message as such!
super(props) is mendetory if using a constructor
It is used when we use constructor
@@kushagragupta4363 ha 9 months ago I was a complete beginner.
Now after all these months. I never class based component in any of my projects.
But it's a good thing to know!
@@siemen_subbaiah wow brother can you tell me which projects should I make If I am beginner in react js
@@kushagragupta4363 if your a beginner do some api fetching projects like use a any movie api and make a project on that.
Or make a expense tracker or a basic to-do list.
In general any project by utilizing am external public api
How to access nested objects in JSON
where can i get this program code
Post is undefined in map method... What's the problem? Anyone plz
1. destructure posts from this.state
2. make sure it starts with a small p,
if it confuses u then use any other variable and make sure u use the same variable inside map method too 👨
How do you get one single item (object) from array?
posts array contains an array of objects so u can simply access any one of them by its id as there is an id property in each objects .. just use map method to loop through each item and return it if its id matches with ur desired id and break the loop ..is there any other method pls let me know ..
@@noobCoder26 thank you for your reply. There is also lodash get() method which does the job very well :)
Thank u man (y)
how to react build for iis server?
Can't we use XMLhttprequest object ??
You can if you want
How to store the response in a cache for the certain time
try the localStorage
why get response two time ???!!
in the index.js file, it has an option for development that says something like you have to choose another mode, because in this mode, it renders all twice, but it does make anything fail, if you wanna know.
your exmaple return Uncaught SyntaxError: expected expression, got '
Probably a typo
How to use this with authentication
google it
why not in the constructor?
It shouldn't have any side effects, it should only initialize values
Document itself asks us to call Ajax requests inside componenDidMount mtd
side effects must be done inside componet did mount not inside constructor
i am getting an error that "can't resolve module axios", please help
open up the terminal in the same directory as App.js and issue the command "npm install axios"
6:39 error message
your voice is not stable