Skip to content

Commit 00f575f

Browse files
committedAug 28, 2021
doc: update README.md
1 parent e6bb1fd commit 00f575f

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed
 

‎README.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -354,33 +354,34 @@ Use examples in [nextjs](https://nextjs.org/). [#52](https://github.com/uiwjs/re
354354

355355
```bash
356356
npm install next-remove-imports
357+
npm install @uiw/react-md-editor@v3.6.0
357358
```
358359

359360
```js
360361
// next.config.js
361362
const removeImports = require('next-remove-imports')();
362-
363363
module.exports = removeImports({});
364364
```
365365

366366
```jsx
367-
// pages/index.js
368-
import Head from 'next/head'
369-
import MDEditor from '@uiw/react-md-editor';
370-
import '@uiw/react-md-editor/dist/markdown-editor.css'
371-
import '@uiw/react-markdown-preview/dist/markdown.css';
367+
import "@uiw/react-md-editor/markdown-editor.css";
368+
import "@uiw/react-markdown-preview/markdown.css";
369+
import dynamic from "next/dynamic";
370+
371+
const MDEditor = dynamic(
372+
() => import("@uiw/react-md-editor").then((mod) => mod.default),
373+
{ ssr: false }
374+
);
372375

373-
export default function Home() {
376+
function HomePage() {
374377
return (
375378
<div>
376-
<Head>
377-
<title>Create Next App</title>
378-
<meta name="description" content="Generated by create next app" />
379-
</Head>
380379
<MDEditor value="**Hello world!!!**" />
381380
</div>
382-
)
381+
);
383382
}
383+
384+
export default HomePage;
384385
```
385386

386387
### Props

1 commit comments

Comments
 (1)

vercel[bot] commented on Aug 28, 2021

@vercel[bot]
Please sign in to comment.