2
2
3
3
_ ProseMirror + React done right_
4
4
5
- ProseMirror is one of the best, if not the best, rich text editors
6
- out there. It may not be written in React, but its render model is
7
- very similar to React's. It is therefore a great fit for your
8
- React project.
5
+ [ ProseMirror] ( https://prosemirror.net/ ) is one of the best rich text editors out there.
6
+ Although it's not written in React, its render model is very
7
+ similar to React's. It is therefore a great fit for your React
8
+ project.
9
9
10
- This package lets you integrate ProseMirror into your project
11
- quickly and correctly, using modern React best practices.
10
+ This package lets you bootstrap a minimal React integration quickly, using
11
+ modern React best practices.
12
12
13
13
## Installation
14
14
@@ -27,7 +27,7 @@ so makes sure you have them installed, too.
27
27
28
28
## Usage
29
29
30
- This is all you need started:
30
+ This is all you need to get started:
31
31
32
32
``` javascript
33
33
import ' prosemirror-view/style/prosemirror.css' ;
@@ -58,16 +58,14 @@ updates using the update function. It accepts the following props:
58
58
59
59
- ` state ` — the ` EditorState ` created by ` useProseMirror ` .
60
60
- ` onChange ` — the update function returned by ` useProseMirror ` .
61
- - ` props ` — (optional) any [ ` DirectEditorProps ` ] ( https://prosemirror.net/docs/ref/#view.DirectEditorProps )
62
- you want set on the ` EditorView ` , except [ ` dispatchTransaction ` ] ( https://prosemirror.net/docs/ref/#view.DirectEditorProps.dispatchTransaction ) .
63
- - ` style ` — (optional) a React style object to be passed the ` div ` containing ProseMirror.
64
- - ` className ` — (optional) a string any classes you want to be passed to the ` div ` containing ProseMirror.
61
+ - ` style ` — (optional) a React style object to pass to the ` div ` containing ProseMirror.
62
+ - ` className ` — (optional) a string of classes you want to pass to the ` div ` containing ProseMirror.
65
63
66
64
It also accepts any
67
- [ ` DirectEditorProp ` ] ( https://prosemirror.net/docs/ref/#view.DirectEditorProps )
68
- except
69
- [ ` dispatchTransaction ` ] ( https://prosemirror.net/docs/ref/#view.DirectEditorProps.dispatchTransaction ) . So, for example, you can
70
- write :
65
+ [ ` EditorProps ` ] ( https://prosemirror.net/docs/ref/#view.EditorProps ) .
66
+ So you can, for example, set
67
+ [ ` transformPastedHTML ` ] ( https://prosemirror.net/docs/ref/#view.EditorProps.transformPastedHTML )
68
+ directly on the component :
71
69
72
70
``` javascript
73
71
< ProseMirror
@@ -85,7 +83,6 @@ If you pass a `ref`, `<ProseMirror />` exposes a `view` getter to retrieve the u
85
83
``` javascript
86
84
const [state , setState ] = useProseMirror ({schema});
87
85
const viewRef = useRef ();
88
-
89
86
return (
90
87
< ProseMirror
91
88
ref= {viewRef}
0 commit comments