React Js How to REFRESH a Component | Best Practice
Вставка
- Опубліковано 16 лют 2022
- In this video, I'll show you how to refresh a component in react js. There are several ways to refresh a component in react js but what is the best approach to refresh a component? I have a real scenario and will show you what solutions we have and what is the best one...
- Наука та технологія
Thank you very much man! That helped me so much! Great video, really useful. Thanks again!
just the video i was looking for XD thanks buddy
Thanks I learned some new technique today.
Thank you so much. It saves lots of time.
Cheers! you helped 71K beginners who try to do their self-learn project 👋👋💖💖
Finally i find a video thanks its really helpful ❤
Thanks alot, u solved my problem ❤
Helped me, thanks
Thanks for this video, it really help me, new sub!
Super super heplful, thanks a lot men!!!!! you're a hero!
Youre a life saver!
Thank you this is a great video, really help me.
Thank you very much.Nice vid.
thank you sir, you've got a new subscriber 😊
Your really talented it's fabulous explanation thank you so much😊🙏🏼
Thanks so much!
Hi! Nice vid. Is there a repository for this video?
Hi sir how to refresh the table data with button please do the videos on the ways of refreshing concepts
i had a similar problem, i had an element with different url, i just had to add on the useEffect the url parameter, so every time it changes it refreshes the page. I hope this helps someone
Doubt: I have a list of users and after clicking on user line i will be redirected to the route of user details component. On that component there is a delete button. And after deletion i am navigating back to users list. But sometimes its not getting updated. So my question is how to refresh a component from another component. Meaning how could i notify my list to refresh on click of delete button?
Create a reload state and set it false and when you delete it set the reload to true and pass it to the component where you wana update . Grab that reload in the function and in the use effective set that reload and the fetching will occur automatically.
Const[reload, setReload] = useState("false")
@@sandeshmaharjan8204 thanks but i guess correct syntax is
const [reload, setReload] = useState(false);
Can you make one video on auto refresh ?
But what's solution if i map array of users, and post new one into array on server. How can i update old array on the page without refreshing page?
You saved me, bro
Thanks!!
Thank you
Thankyou sir 🙏🙏
this solution happen if you add new data. how about mutate an old data inside the array state?
I incremented the like total by 1
my components are not refreshing on server while i am changing the link .what is reason behind it?
The same prblm, Did u found any solution ?
How to use this same principle when we delete element via api ?
It should works with any api
can i do this using class component ?
Yes, you can use the setState method to update the state.
thanks
Was it helpful?
Ewolla ba in lahheh Iranit
Where R U From?
I am coming from where are you 😀
@@ReactWithMasoud I am coming from where you are.
When you say refresh, it's actually misleading. You should say "re-render" which is a main concept in React. Plus, you're not suppose to forceUpdate unless you're doing something wrong with React or it's a very typical situation.
Didnt solve my problem