You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
| defaultValue | String | The default value with which the editor should be populated. Should be an HTML string generated from draft.js using [draft-js-export-html](https://www.npmjs.com/package/draft-js-export-html). |
41
-
| onEditorReady | Function | A callback function that will be called when the editor has loaded and is ready to use. Ensure this function is called before you apply any instance methods. |
42
-
| style |[React Native View Style](https://facebook.github.io/react-native/docs/style)| Use this to style the View Component that is wrapping the rich text editor. |
43
-
| placeholder | String | A placeholder string for the text editor. |
44
-
| ref | React Ref Object | Pass a ref here to access the instance methods. |
45
-
| onStyleChanged | Function | Will call a function with an Array of styles [] in the current editor's context. Use this to keep track of the applied styles in the editor. |
46
-
| onBlockTypeChanged | Function | will call a function with a block type in the current editor's context. Use this to keep track of the applied block types in the editor. |
| defaultValue | String | The default value with which the editor should be populated. Should be an HTML string generated from draft.js using [draft-js-export-html](https://www.npmjs.com/package/draft-js-export-html). |
41
+
| onEditorReady | Function | A callback function that will be called when the editor has loaded and is ready to use. Ensure this function is called before you apply any instance methods. |
42
+
| style |[React Native View Style](https://facebook.github.io/react-native/docs/style)| Use this to style the View Component that is wrapping the rich text editor. |
43
+
| placeholder | String | A placeholder string for the text editor. |
44
+
| ref | React Ref Object | Pass a ref here to access the instance methods. |
45
+
| onStyleChanged | Function | Will call a function with an Array of styles [] in the current editor's context. Use this to keep track of the applied styles in the editor. |
46
+
| onBlockTypeChanged | Function | will call a function with a block type in the current editor's context. Use this to keep track of the applied block types in the editor. |
47
+
| styleMap | Object | A custom style map you can pass to add custom styling of elements in your text editor. Refer [Draft.js](https://draftjs.org/docs/advanced-topics-inline-styles#mapping-a-style-string-to-css) Docs |
48
+
| styleSheet | String | A CSS string which you can pass to style the HTML in which the rich text editor is running. This can be used if you want to change fonts and background colors of the editor etc. |
49
+
50
+
`styleMap` and `styleSheet` are parsed as strings and are sent over to the webview. To prevent the string parsing from failing, please do not use single quotes `'` within the `styleMap` object's keys and values or inside the `styleSheet` string.
| focus | - | shift focus to the rich text editor |
57
+
| blur | - | removes focus from the rich text editor |
53
58
| setStyle |`BOLD`, `ITALIC`, `UNDERLINE` and `CODE`| call this instance method to apply a style to the selected/active text. Call this again with the same style to remove it. |
54
59
| setBlockType | Supports the default block types supported by draft.js [editor](https://github.com/facebook/draft-js/blob/master/src/component/utils/DraftStyleDefault.css)| Call this instance method to apply and call it again to remove the style. |
55
60
| getEditorState | - | Returns the current editor state as a HTML string exported using [draft-js-export-html](https://www.npmjs.com/package/draft-js-export-html). |
0 commit comments