[x] Do not reload app when navigating between pages (e.g: click on "Đọc tiếp", "Đọc ngẫu nhiên", Logo, article link)
Do not need passHref when the direct child is <a>.
If the direct child of <Link /> component is not <a>, even though we pass passHref, it still triggers a full-page reload
There is no route such as /, so clicking on the logo triggers the full-page reload. Workaround by changing / => /page/1 (same for 404 page). I think the correct way to fix this is we need to have / route, then redirect to /page/1. But I'm not very familiar with that and we can leave it in the upcoming PR.
Fixes
passHref
when the direct child is<a>
.<Link />
component is not<a>
, even though we passpassHref
, it still triggers a full-page reload/
, so clicking on the logo triggers the full-page reload. Workaround by changing/
=>/page/1
(same for 404 page). I think the correct way to fix this is we need to have/
route, then redirect to/page/1
. But I'm not very familiar with that and we can leave it in the upcoming PR.Reference: https://nextjs.org/docs/api-reference/next/link
Screenshots
The full-page reload is triggered when navigating between pages. Please look at the loading icon on the left of page title.
Future work