8000 Add a custom widget to recogito using React components · Issue #108 · recogito/recogito-js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add a custom widget to recogito using React components #108
Open
@AnthonyKamers

Description

@AnthonyKamers

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:
image

While the HelloPluginJsx is the following:
image

I get the following error:
image

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0