rsnext/examples/with-draft-js/README.md

45 lines
1.5 KiB
Markdown
Raw Normal View History

2018-02-09 09:40:32 +01:00
# DraftJS Medium editor inspiration
2020-04-09 19:54:59 +02:00
Have you ever wanted to have an editor like medium.com in your Next.js app? DraftJS is available for SSR, but some plugins like the toolbar are using `window`, which does not work when doing SSR.
This example aims to provides a fully customizable example of the famous medium editor with DraftJS. The goal was to get it as customizable as possible, and fully working with Next.js without using the react-no-ssr package.
## Deploy your own
Deploy the example using [Vercel](https://vercel.com):
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/with-draft-js)
2018-02-09 09:40:32 +01:00
## How to use
### Using `create-next-app`
Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
2018-02-09 09:40:32 +01:00
```bash
npm init next-app --example with-draft-js
# or
yarn create next-app --example with-draft-js with-draft-js-app
2018-02-09 09:40:32 +01:00
```
### Download manually
Download the example:
2018-02-09 09:40:32 +01:00
```bash
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-draft-js
cd with-draft-js
```
Install it and run:
```bash
npm install
npm run dev
# or
yarn
yarn dev
2018-02-09 09:40:32 +01:00
```
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).