Skip to content

Commit 5604e13

Browse files
committed
doc: add example. #695
1 parent 4343cb0 commit 5604e13

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

core/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,27 @@ export default function App() {
588588
}
589589
```
590590

591+
Set to support editor only
592+
593+
```jsx mdx:preview
594+
import React, { useContext } from "react";
595+
import MDEditor, { commands, EditorContext } from "@uiw/react-md-editor";
596+
597+
export default function App() {
598+
const [value, setValue] = React.useState("**Hello world!!!**");
599+
return (
600+
<div className="container">
601+
<MDEditor
602+
value={value}
603+
preview="edit"
604+
extraCommands={[commands.fullscreen]}
605+
onChange={(val) => setValue(val)}
606+
/>
607+
</div>
608+
);
609+
}
610+
```
611+
591612
### Editor Font Size
592613

593614
[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/markdown-editor-for-react-uiwjs-react-md-editor-issues-425-2epmgh?fontsize=14&hidenavigation=1&theme=dark)

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@
2323
"devDependencies": {
2424
"@kkt/less-modules": "^7.4.9",
2525
"@kkt/ncc": "^1.0.14",
26-
"@types/react-test-renderer": "~18.0.0",
2726
"@types/react": "~18.2.0",
2827
"@types/react-dom": "~18.2.0",
28+
"@types/react-test-renderer": "~18.0.0",
2929
"compile-less-cli": "~1.9.0",
3030
"husky": "~8.0.0",
31+
"jest": "^29.5.0",
32+
"jest-environment-jsdom": "^29.5.0",
33+
"jest-environment-node": "^29.5.0",
34+
"jest-watch-typeahead": "^2.2.2",
3135
"kkt": "^7.4.9",
3236
"lerna": "8.0.0",
3337
"lint-staged": "^15.1.0",
3438
"prettier": "^3.0.0",
35-
"react-test-renderer": "~18.2.0",
36-
"tsbb": "^4.5.1",
37-
"jest": "^29.5.0",
38-
"jest-watch-typeahead": "^2.2.2",
39-
"jest-environment-jsdom": "^29.5.0",
40-
"jest-environment-node": "^29.5.0",
4139
"react": "~18.2.0",
42-
"react-dom": "~18.2.0"
40+
"react-dom": "~18.2.0",
41+
"react-test-renderer": "~18.2.0",
42+
"tsbb": "^4.5.1"
4343
},
4444
"lint-staged": {
4545
"*.{js,jsx,less,md,json}": [

0 commit comments

Comments
 (0)