Skip to content
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

Feature Request - Highlight plugin accept ReactElement #97

Open
leo-paz opened this issue Dec 15, 2023 · 1 comment
Open

Feature Request - Highlight plugin accept ReactElement #97

leo-paz opened this issue Dec 15, 2023 · 1 comment

Comments

@leo-paz
Copy link

leo-paz commented Dec 15, 2023

Hi,

First of all, product is great and we've bought a license. We're now adding the ability for users to be able to add comments/notes with the HighlightPlugin. It would be great if the render... fields we pass to the highlightPlugin accepted ReactElements instead of a function that returns ReactElement as this would allow us to use hooks and what not in these elements.

I currently get this error trying to use hooks in these functions:
image

Cheers,
Leo

@leo-paz
Copy link
Author

leo-paz commented Dec 15, 2023

@phuocng

Perhaps this would fix it?

export interface HighlightPluginProps {
    renderHighlightTarget?: React.ReactElement<RenderHighlightTargetProps>;
    renderHighlightContent?: React.ReactElement<RenderHighlightContentProps>;
    renderHighlights?: React.ReactElement<RenderHighlightsProps>;
    trigger?: Trigger;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant