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
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.

theme

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

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