Expo (React Native) app with BlockNote: native toolbar + WebSocket bridge #2618
Movm
started this conversation in
Ideas & Enhancements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
BlockNote in a native Expo app with native formatting toolbar
We built a full Expo (React Native) app that runs BlockNote inside a DOM WebView with a native formatting toolbar and real-time Hocuspocus collaboration via a WebSocket bridge.
This pattern is production-tested in Grünerator — our collaborative document editor running on iOS and Android with real-time Hocuspocus sync, native formatting toolbar, and chat sidebar. The standalone example repo below is extracted from this production app.
Example repo: Movm/blocknote-app (freshly extracted — not yet independently tested, but the underlying code runs in production)
Architecture
BlockNote runs inside an Expo
use domcomponent (web code in a native WebView). The native app and DOM editor communicate via a Zustand bridge store:1. DOM → Native: active styles reporting
Inside the BlockNote editor (DOM), we subscribe to selection changes and report active styles back to native:
2. Native → DOM: formatting commands
The native toolbar dispatches actions through the bridge store, which flow as props to the DOM component and get dispatched as
CustomEvents:The editor listens for these events and applies formatting:
3. Native formatting toolbar
Pure React Native —
ScrollViewwithPressablebuttons reading from the bridge store:4. WebSocket bridge for Hocuspocus
Expo DOM components can not open WebSockets directly, so we proxy them through native async props:
Why native toolbar over web toolbar on mobile
Related
Beta Was this translation helpful? Give feedback.
All reactions