rsnext/examples/with-typescript-types
Dominic Elm d2caaeab64
docs: add 'Open in StackBlitz' buttons to various examples (#25853)
This PR adds a `Preview` section and a `Open in StackBlitz` button to various examples. I have tested all examples and omitted the ones that require third party API keys, or didn't work. Some examples don't work locally either.

Here's an example:
![image](https://user-images.githubusercontent.com/12571019/121027783-88971280-c7a7-11eb-851a-0ad30cf74b42.png)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [x] Examples updated
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-08 20:45:02 +00:00
..
pages chore(examples): fix missing document components error messages (#16802) 2020-09-03 21:13:12 +00:00
types [Example] with-typescript-types (#13746) 2020-06-04 16:25:28 +00:00
.gitignore Added .gitignore to examples that are deployed to vercel (#15127) 2020-07-16 10:52:23 -04:00
next-env.d.ts [Example] with-typescript-types (#13746) 2020-06-04 16:25:28 +00:00
package.json Upgrade typescript to 4.0 (#16673) 2020-08-29 22:17:02 -04:00
README.md docs: add 'Open in StackBlitz' buttons to various examples (#25853) 2021-06-08 20:45:02 +00:00
tsconfig.json Update tsconfig of example to be consistent with default output of next.js (#25581) 2021-06-03 22:31:14 +00:00

This example shows how to integrate the TypeScript type system into Next.js. Since TypeScript is supported out of the box with Next.js, all we have to do is to install TypeScript.

This example shows how to properly export and import typescript types without getting the

Attempted import error: 'TypeA' is not exported from './package-1'.

error as raised in vercel/next.js#7882.

Preview

Preview the example live on StackBlitz:

Open in StackBlitz

Add import type and export type support to TypeScript