Editor
Editor is used to create the context, define all translations and initialize EditorState (from draft.js)
onInit
Function called when component is mount. Can serve to set editor values for example. (default: () => null
)
import { Editor } from '@kisskissbankbank/underwood';
<Editor
onInit={() => helpers.setValue(field.value)}
/>;
translations
An object that contains all the necessary translations (default: {}
)
import { Editor } from '@kisskissbankbank/underwood';
<Editor
translations={{
title: "Such a great lib!"
description: "Doc created with Dicosaurus"
}}
/>;
configResponsiveImageHandler
As the images are optimized and saved in a lambda service, we need to be sure that the server request is authorized. So we pass the configuration with authorized servers and hosts. (default: {}
)
import { Editor } from '@kisskissbankbank/underwood';
<Editor
configResponsiveImageHandler={{
host: "https://www.kisskissbankbank.com/resize",
allowedServers: ["localhost:1234", "localhost:5678"]
}}
/>;
children
Children passed to Editor component.
import { Editor, Playground } from '@kisskissbankbank/underwood';
<Editor>
<Playground />
<Editor/>;