Y-monaco and React


I haven’t found a way to make y-monaco work with React yet.

The best way to use Monaco in React seems to be using this package GitHub - suren-atoyan/monaco-react: Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins.

In this codesandbox example, I try to use a hook to bind yjs to the Monaco editor.

  1. There is an error “$csb__lder_js.createStringBuilder is not a function”
  2. When I run this code in my Nextjs project, it works, I can edit some text in the Monaco editor, it syncs, but then it stops syncing and the ydoc text type gets stuck, even if I try to consult it from the official y-monaco demo, for instance.

Did someone manage to use yjs, monaco and React all together ?


After many attemps, it appears that using hocus pocus is solving my problems.

It’s finally open source :partying_face:

1 Like

Glad to hear, that Hocuspocus helps you :slight_smile: