Skip to content
This repository was archived by the owner on May 31, 2020. It is now read-only.

Commit 0bdb8c6

Browse files
committed
docs(core): add missing props and simplified documentation
1 parent 6f7b84e commit 0bdb8c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020

2121
### Usage
2222

23-
`EditorContainer` contains all props for the draft js Editor which it passes down to plugins and the `Editor` via the React context api.
23+
`EditorContainer` contains all props for the draft js Editor which it passes down to plugins and the `Editor` via the [React context api](https://reactjs.org/docs/context.html).
2424

2525
```js
2626
import { EditorContainer } from '@djsp/core'
@@ -38,6 +38,7 @@ Here are the props that `EditorContainer` accepts, all of the below props are in
3838
| - | - | - | - |
3939
| `editorState` | `EditorState` | required | The state of the editor. Identical to the [draft js editorState prop](https://draftjs.org/docs/api-reference-editor#editorstate) |
4040
| `onChange` | `(EditorState) => void` | required | Fired when content changes. Identical to the [draft js onChange prop](https://draftjs.org/docs/api-reference-editor#onchange) |
41+
| `editorKey` | `string` | optional | Overrides [props set via plugin](#setEditorProps) |
4142
| `textAlignment` | `"left" or "center" or "right"` | optional | Overrides [props set via plugin](#setEditorProps) |
4243
| `textDirectionality` | `"LTR" or "RTL"` | optional | Overrides [props set via plugin](#setEditorProps) |
4344
| `placeholder` | `string` | optional | Overrides [props set via plugin](#setEditorProps) |
@@ -139,7 +140,7 @@ The `Plugin` also accepts an optional render prop which exposes the plugin conte
139140
| - | - | - |
140141
| `editorState` | `EditorState` | The `EditorState` object |
141142
| `setEditorState` | `(editorState: EditorState) => void` | Lets you update the editorState |
142-
| `editorProps` | `Object` | Contains props that can be set via `setEditorProps`, these are `editorKey` `placeholder` `textAlignment` `textDirectionality` `readOnly` `spellCheck` `stripPastedStyles` `tabIndex` `autoCapitalize` `autoComplete` `autoCorrect` `ariaActiveDescendantID` `ariaAutoComplete` `ariaControls` `ariaDescribedBy` `ariaExpanded` `ariaLabel` `ariaLabelledBy` `ariaMultiline` `webDriverTestID` |
143+
| `editorProps` | `Object` | Contains the [props for `EditorContainer`](#props) except `editorState` and `onChange` |
143144
| `setEditorProps` | `(editorProps: Object) => void` | lets you set the above editorProps. Be aware that editor props set via Plugins are overridden by `EditorContainer` props |
144145
| `editorRef` | `Ref<DraftEditor>` | A React reference to the draft js editor |
145146

0 commit comments

Comments
 (0)