Saul-Mirone / prosemirror-adapter

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

`useWidgetViewFactory` always returns an undefined value #51

Closed segfall closed 1 year ago

segfall commented 1 year 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 1 year 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