README.md 1.2 KB
Newer Older
1 2
# Example with portals

3 4 5 6 7 8
## Deploy your own

Deploy the example using [ZEIT Now](https://zeit.co/now):

[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/new/project?template=https://github.com/zeit/next.js/tree/canary/examples/with-portals)

9 10
## How to use

11 12
### Using `create-next-app`

13
Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example:
14

15 16 17 18
```bash
npx create-next-app --example with-portals with-portals-app
# or
yarn create next-app --example with-portals with-portals-app
19 20 21 22
```

### Download manually

23
Download the example:
24 25

```bash
26
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-portals
27 28 29 30 31 32 33 34
cd with-portals
```

Install it and run:

```bash
npm install
npm run dev
35 36 37
# or
yarn
yarn dev
38 39
```

40
Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download)):
41 42 43 44 45 46 47 48

```bash
now
```

## The idea behind the example

This example show how to use the React [Portals](https://reactjs.org/docs/portals.html) feature with Next.js.