rsnext/examples/data-fetch
Henrik Wenz 16838d5dd4
[Docs] Migrate data-fetch example to typescript (#39852)
## Changelog

- Updated deps
- Migrated to Typescript
- Replaced `div` with `Fragment`

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-23 14:23:38 +00:00
..
pages [Docs] Migrate data-fetch example to typescript (#39852) 2022-08-23 14:23:38 +00:00
types [Docs] Migrate data-fetch example to typescript (#39852) 2022-08-23 14:23:38 +00:00
.gitignore Update default gitignore templates (#39051) 2022-07-26 20:08:40 -05:00
package.json [Docs] Migrate data-fetch example to typescript (#39852) 2022-08-23 14:23:38 +00: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 [Docs] Migrate data-fetch example to typescript (#39852) 2022-08-23 14:23:38 +00:00

Data fetch example

Next.js was conceived to make it easy to create universal apps. That's why fetching data on the server and the client when necessary is so easy with Next.js.

By using getStaticProps Next.js will fetch data at build time from a page, and pre-render the page to static assets.

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 data-fetch data-fetch-app
yarn create next-app --example data-fetch data-fetch-app
pnpm create next-app --example data-fetch data-fetch-app

Deploy it to the cloud with Vercel (Documentation).