WidgetComponentProvider
Home > @gooddata/sdk-ui-dashboard > IDashboardCustomComponentProps > WidgetComponentProvider
IDashboardCustomComponentProps.WidgetComponentProvider property
Specify function to obtain custom component to use for rendering a widget.
Signature:
WidgetComponentProvider?: OptionalWidgetComponentProvider;
Remarks
- If not provided, the default implementation will be used. - If factory function is provided and it returns undefined, then the default implementation . This is useful if you want to customize just one particular widget and keep default rendering for the other widgets.
Example
// Simple component that alters the title of every widget
const CustomWidget = (props) => {
const widget: IInsightWidget = {
...props.widget,
title: `Prepend to ${props.widget.title}`,
};
return <DefaultDashboardWidget {...props} widget={widget} />;
};