Description
Hello, I'm trying to add a custom widget to RecogitoJS (using that NPM package provided) using React components, but I'm getting an error probably because of what @rsimon said here:
It looks like it's currently not possible to use Preact hooks in a Recogito plugin. Using Hooks with React should work; and class components should also work (both with React and Preact).
I can hopefully figure out a workaround for this in the future. But for now, this seems to be a limition :-(
I tried to use class components, functional components, changing React for Preact, but nothing seemed to work.
I would like to use the recogito-js library directly or modify the minimum possible. Is there a way I can use the webpack provided in recogito-comments-mention so recogito-client-core would accept React components?
I just instantiate a new Recogito instance as the following:
While the HelloPluginJsx
is the following:
Debugging it, I found out that recogito-client-core/src/editor/widgets/index.jsx#getWidget
is not considering it as a React plugin, so it calls instantiate(args)
directly.
Originally posted by @AnthonyKamers in #15 (comment)