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...
  • Наука та технологія

КОМЕНТАРІ • 45

  • @MyKreber
    @MyKreber Рік тому +2

    Thank you very much man! That helped me so much! Great video, really useful. Thanks again!

  • @alfonsopayra
    @alfonsopayra Рік тому

    just the video i was looking for XD thanks buddy

  • @haha-eg8fj
    @haha-eg8fj Рік тому

    Thanks I learned some new technique today.

  • @Ahmedahmed-qg5ep
    @Ahmedahmed-qg5ep Рік тому

    Thank you so much. It saves lots of time.

  • @yas12356
    @yas12356 3 місяці тому

    Cheers! you helped 71K beginners who try to do their self-learn project 👋👋💖💖

  • @didheemosesebastian821
    @didheemosesebastian821 Рік тому

    Finally i find a video thanks its really helpful ❤

  • @praisebanks
    @praisebanks 4 місяці тому +1

    Thanks alot, u solved my problem ❤

  • @MridulBorah2014
    @MridulBorah2014 16 днів тому

    Helped me, thanks

  • @ismaelhernandez4898
    @ismaelhernandez4898 Рік тому

    Thanks for this video, it really help me, new sub!

  • @juanjose6319
    @juanjose6319 Місяць тому

    Super super heplful, thanks a lot men!!!!! you're a hero!

  • @Vimal108_-
    @Vimal108_- Рік тому

    Youre a life saver!

  • @davidgallego1216
    @davidgallego1216 Рік тому

    Thank you this is a great video, really help me.

  • @ulugbekvaxidov7339
    @ulugbekvaxidov7339 Рік тому

    Thank you very much.Nice vid.

  • @elkhanhamet2561
    @elkhanhamet2561 Рік тому

    thank you sir, you've got a new subscriber 😊

  • @marimuthur9456
    @marimuthur9456 2 роки тому

    Your really talented it's fabulous explanation thank you so much😊🙏🏼

  • @wevertonsantiago8124
    @wevertonsantiago8124 Рік тому

    Thanks so much!

  • @trondnado
    @trondnado Рік тому

    Hi! Nice vid. Is there a repository for this video?

  • @sravanimaragani2338
    @sravanimaragani2338 Рік тому +1

    Hi sir how to refresh the table data with button please do the videos on the ways of refreshing concepts

  • @alexei000
    @alexei000 Рік тому

    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

  • @RockstarGamer4531
    @RockstarGamer4531 Рік тому +5

    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?

    • @sandeshmaharjan8204
      @sandeshmaharjan8204 20 днів тому

      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")

    • @RockstarGamer4531
      @RockstarGamer4531 20 днів тому

      @@sandeshmaharjan8204 thanks but i guess correct syntax is
      const [reload, setReload] = useState(false);

  • @jaysingh5402
    @jaysingh5402 Рік тому

    Can you make one video on auto refresh ?

  • @lesjoni8347
    @lesjoni8347 Рік тому +1

    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?

  • @isaaclee7411
    @isaaclee7411 Рік тому

    You saved me, bro

  • @kelvinpenha9669
    @kelvinpenha9669 Рік тому

    Thanks!!

  • @Eikichi_Uchiha
    @Eikichi_Uchiha 2 роки тому

    Thank you

  • @rushikeshjadhav7748
    @rushikeshjadhav7748 10 місяців тому

    Thankyou sir 🙏🙏

  • @celestial8610
    @celestial8610 Рік тому

    this solution happen if you add new data. how about mutate an old data inside the array state?

  • @netsaosa4973
    @netsaosa4973 Рік тому

    I incremented the like total by 1

  • @nusratnigar3209
    @nusratnigar3209 Рік тому +1

    my components are not refreshing on server while i am changing the link .what is reason behind it?

  • @sadickminnih1921
    @sadickminnih1921 2 роки тому

    How to use this same principle when we delete element via api ?

  • @houssemkoubaa3746
    @houssemkoubaa3746 Рік тому

    can i do this using class component ?

    • @ReactWithMasoud
      @ReactWithMasoud  Рік тому +1

      Yes, you can use the setState method to update the state.

  • @svloex
    @svloex 2 роки тому

    thanks

  • @kadeus
    @kadeus 2 роки тому

    Ewolla ba in lahheh Iranit

  • @amirkian1181
    @amirkian1181 2 роки тому

    Where R U From?

    • @ReactWithMasoud
      @ReactWithMasoud  2 роки тому +1

      I am coming from where are you 😀

    • @amirkian1181
      @amirkian1181 2 роки тому

      @@ReactWithMasoud I am coming from where you are.

  • @kirarevcrow
    @kirarevcrow Рік тому +3

    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.

  • @letswitswa7411
    @letswitswa7411 Рік тому +1

    Didnt solve my problem