-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Labels
Description
I am getting some typescript issues that are a bit difficult to resolve when trying to override the components in the JSXParser components map prop. Sample code below:
<JSXParser
components={{
PieChart: (props: React.ComponentProps<typeof PieChart>) => (
<ErrorBoundary FallbackComponent={ErrorFallback}>
<PieChart
{...(props as React.ComponentProps<typeof PieChart>)}
container={
CardComponent as React.ComponentType<ContainerComponentProps>
}
/>
</ErrorBoundary>
),
}}
jsx={
"<PieChart userOptions={{ dataLabels: { enabled: true }, stroke: { show: false } }} />"
}
/>I seem to be getting this error:
Type '(props: React.ComponentProps<typeof PieChart>) => JSX.Element' is not assignable to type 'ComponentType | ExoticComponent<{}>'
Is there a way to extend (or override) the types provided for the JSXParser component to fix these errors.
Reactions are currently unavailable