A last target abstracts aside the differences in various environments and you may provides a decreased API you to definitely allows you to manage a brief history stack, browse, and you can persevere county anywhere between instructions. – Function Education docs
For each and every parts produces a history target you to monitors the new current place ( background.venue ) together with early in the day metropolises inside the a stack. In the event the most recent place changes, the view was re also-rendered and you also rating a sense of navigation. Why does the present day venue change? A brief history target has tips such as for instance background.push and you may record.replace to undertake you to definitely. A brief history.force experience invoked after you click on an element, and background.replace is called if you use a good . Other actions – such as record.goBack and records.goForward – are accustomed to browse from the record heap because of the for the past otherwise pass a typical page.
Hook and you may Channel Parts
Brand new role is the most important component for the Work Router. It makes specific UI in the event the latest location fits brand new route’s road. If at all possible, a component should have an effective prop entitled street , and if the path identity fits the present day place, it becomes rendered.
- parts, on the other hand, can be used so you can navigate anywhere between pages. It’s comparable to the new HTML anchor element. Yet not, playing with point backlinks carry out end up in a typical page revitalize, which we do not wanted. (mehr …)