react link vs a tag and arrow function

后端 未结 4 1875
陌清茗
陌清茗 2020-12-05 13:52

Hi guys I\'m a beginner programmer just started on react router.

I have two questions. What is the difference between using an

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 13:59

    The href attribute would trigger a page refresh which would reset the application states. However the link and navlink of react-router doesn't trigger a page refresh. Since React is used to create single page applications most of the time make sure you choose Link or Navlink when working with routing

提交回复
热议问题