Skip to main content

useEditorBridge

a react hook that will return EditorBridge

bridgeExtensions

BridgeExtension[]
default: undefined
A list of BridgeExtensions that will be added to the editor on the native side

initialContent

string | json
default: undefined
initial content that will be loaded first on the editor

autofocus

boolean
default: false
when true the editor will auto focus

avoidIosKeyboard IOS ONLY

boolean
default: false
This helps us keep the cursor right above the keyboard when the editor is full-screen and the virtual keyboard hides the bottom portion of the editor.

dynamicHeight

boolean
default: false
when true the editor's webview will keep the same height as the content height

disableColorHighlight

boolean
default: undefined
when true the selection highlight will be off and when false will be on, on android this will be off by default, please see: https://github.com/10play/10tap-editor/issues/184#issuecomment-2304826219

theme

EditorTheme
default: defaultEditorTheme (light theme)
this prop can be used to customize default styles, see theme example

editable

boolean default: true
When set to false the editor will be readonly

customSource

string
default: SimpleEditorBundleString
used in advance setup, an HTML string that will replace the default simple editor

onChange

() => void you can assign a callback that will be called each time the editors content has changed. Inside this function you can call editor.getHTML, editor.getJSON or editor.getText to get the content. The content is not directly provided as to not create allot of traffic between the webview and native. It is recommended to request the content in some debounced function and not each change.

DEV

boolean
default: false
prop used in advance setup, when true the webview will load DEV_SERVER_URL instead of the html string

DEV_SERVER_URL

string
default: http://localhost:3000
prop used in advanced setup, a url string that points to the editor dev server