examples icon indicating copy to clipboard operation
examples copied to clipboard

Feature Request - Highlight plugin accept ReactElement

Open leo-paz opened this issue 1 year ago • 1 comments
trafficstars

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 avatar Dec 15 '23 18:12 leo-paz

@phuocng

Perhaps this would fix it?

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

leo-paz avatar Dec 15 '23 19:12 leo-paz