You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<main>{slot}</main> {/*<-- a route content will be placed here*/}
70
71
</>
@@ -222,12 +223,18 @@ const routes: Routes = [
222
223
223
224
## Navigation
224
225
225
-
### via `RouterLink`
226
+
### via `Link` or `NavLink`
226
227
227
228
```tsx
228
-
<RouterLinkto='/home'>Home</RouterLink>
229
+
<Linkto='/user/50'>Go to profile</Link>
230
+
<NavLinkto='/home'>Home</NavLink>
229
231
```
230
232
233
+
`NavLink` internally uses `Link`, but at the same time provides a CSS class `.active-link` if the current URL is equal to or contains the `to` parameter of `NavLink`.
234
+
`NavLink` can be used for headers and menus, which will continue to be on the page when it is clicked and the content is changed.
235
+
`Link` means that it will disappear from the screen after you click it and go to another page. Of course you can create your own logic based on `Link`, using it as a base component.
0 commit comments