Saul-Mirone / prosemirror-adapter

Universal adapter to create prosemirror nodeview from modern UI frameworks.
MIT License
97 stars 7 forks source link

`useWidgetViewFactory` always returns an undefined value #51

Closed segfall closed 12 months ago

segfall commented 12 months ago

Thank you for creating this repo. I was trying to build a custom editor I discovered that useWidgetViewFactory seems to work in React, but always seem to return an undefined value in Vue.

I've created a test environment which demonstrate this edgecase: https://stackblitz.com/edit/github-rdvuhn?file=createEditorView.ts

Am I mis-using or misunderstanding how useWidgetViewFactory works?

Saul-Mirone commented 12 months ago

You need to wrap your editor with ProsemirrorAdapterProvider, something like https://github.com/Saul-Mirone/prosemirror-adapter/blob/main/examples/vue/App.vue#L8