Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xranx OpenContext Mobile EditorApp

From Leeroopedia
Knowledge Sources
Domains Mobile, Editor, React
Last Updated 2026-10-24 00:00 GMT

Overview

React component that bridges the Tiptap markdown editor into a React Native WebView, using postMessage for bidirectional communication with the native iOS app.

Description

The EditorApp.jsx in src/ui/src/mobile/ is the WebView-side entry point for the iOS app's editor. It receives load messages (setting markdown content and editor ID) and setLocale messages (changing i18n language) from the native side via window.message events. On content change, it posts contentChange messages back to window.ReactNativeWebView. It renders the TiptapMarkdownEditor component with the received markdown.

Usage

Load this component as the WebView content in the iOS EditorWebView component.

Code Reference

Source Location

Signature

export default function EditorApp()

Import

import EditorApp from './mobile/EditorApp';

I/O Contract

Inputs (via postMessage)

Name Type Required Description
type string Yes "load" or "setLocale"
payload.id string No (load) Editor instance ID
payload.markdown string No (load) Initial markdown content
payload.locale string No (setLocale) Language code

Outputs (via postMessage)

Name Type Description
ready Event Emitted on mount
contentChange Event { markdown } on content change

Usage Examples

WebView Bridge Protocol

// Native side (React Native)
const webViewRef = useRef(null);

// Send content to editor
webViewRef.current.injectJavaScript(
  `window.postMessage(JSON.stringify({ type: 'load', payload: { id: 'doc-1', markdown: '# Hello' } }))`
);

// Receive content changes
onMessage={(event) => {
  const msg = JSON.parse(event.nativeEvent.data);
  if (msg.type === 'contentChange') {
    setContent(msg.payload.markdown);
  }
}}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment