rsnext/examples/using-router
Jan Kaifer f3ef4e99b0
Cover 1st-party examples with tests (#45270)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
We want to make sure that our examples are not breaking.
We don't want to be slowed down by broken 3rd party packages, but we
need to ensure that examples covering next.js features are always green.

Added as a standalone workflow that doesn't parallelize. It will just
run on a cron schedule, so we can check for current status. We can add
Slack ping later if we need to.

The workflow tests just that our examples can build, so mostly TS
issues. We could definitely follow up with actual tests, but that is not
as low-hanging.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-02-27 11:54:24 +01:00
..
components chore: refactor using-router example (#40774) 2022-09-21 23:37:57 +00:00
pages chore: refactor using-router example (#40774) 2022-09-21 23:37:57 +00:00
.gitignore Update default gitignore templates (#39051) 2022-07-26 20:08:40 -05:00
package.json Cover 1st-party examples with tests (#45270)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Tim Neutkens <tim@timneutkens.nl> 2023-02-27 11:54:24 +01:00
README.md docs(examples): improve DX while copying command to create new project (#38410) 2022-07-26 21:57:48 -05:00
tsconfig.json chore: refactor using-router example (#40774) 2022-09-21 23:37:57 +00:00

Example app utilizing next/router for routing

This example features:

  • An app linking pages using next/router instead of <Link> component.
  • Access the pathname using next/router and render it in a component

Deploy your own

Deploy the example using Vercel or preview live with StackBlitz

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example using-router using-router-app
yarn create next-app --example using-router using-router-app
pnpm create next-app --example using-router using-router-app

Deploy it to the cloud with Vercel (Documentation).