Skip to content

Instantly share code, notes, and snippets.

View joevingracien's full-sized avatar
🏠
Working from home

Joevin joevingracien

🏠
Working from home
View GitHub Profile
@joevingracien
joevingracien / index.html
Created May 21, 2024 19:32 — forked from colepeters/index.html
Example of a custom element to prefetch a link's `href`
<prefetched-link href="https://prefetch-this-href.example.org">
This link's href is prefetched if the user is on a fast network
</prefetched-link>
@joevingracien
joevingracien / 00-README-NEXT-SPA.md
Created March 18, 2023 15:08 — forked from gaearon/00-README-NEXT-SPA.md
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Building