Skip to content

Instantly share code, notes, and snippets.

View pvaladez's full-sized avatar

Peter Valadez pvaladez

View GitHub Profile
@pvaladez
pvaladez / nvmCommands.js
Created December 4, 2023 22:52 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@pvaladez
pvaladez / 00-README-NEXT-SPA.md
Created May 10, 2023 04:07 — 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.)

Don't like Next? Here's how to do the same in Gatsby.