-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a custom widget to recogito using React components #108
Comments
Hi @AnthonyKamers, the error definitely indicates a mismatch between (P)React versions in RecogitoJS and your own host app. (It's a long story but there's no reliable way to differentiate between whether something is a React component and a normal JS function. At least none that wouldn't change unexpectedly between versions...) For that and other reasons, I've sort of stopped maintaining RecogitoJS. An official successor is almost there: https://github.com/recogito/text-annotator-js The main missing piece is that it doesn't have any documentation yet. I'm hoping to work on it in the latter half of August. But if you're brave enough to fight your way through source code and the test example, I frankly think you might be better off using the new package. Note that the new package is organized differently: it does not include a built-in popup! However, it does have a dedicated package with React bindings, and that also includes a Let me know if you manage to get started with this. Things get a bit more complicated than the initial example once you start interacting with the annotation (adding tags, comments, etc.) But that will all get documented in August - fingers crossed. |
Hey Simon, Thank you for your answer. I was looking at the As I advance on my example, I can share it with you later so that it helps with the documentation. |
Hi, I'm not sure if this is what you mean, but: if you are making a text selection, and there is no visible annotation, then it's much more likely you haven't imported the Text Annotator CSS stylesheet to your project (e.g. |
Sure, that was the problem!! Thank you. |
@rsimon I have created an issue to |
I wrote a reply. Re contributing: that's welcome of course! Simply fork the repository and send pull requests. |
Got it, thank you! |
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:
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:I get the following error:

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 callsinstantiate(args)
directly.Originally posted by @AnthonyKamers in #15 (comment)
The text was updated successfully, but these errors were encountered: