Skip to content

Commit

Permalink
fix(Title): return class component (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaryaLari authored Jan 13, 2025
1 parent a647ad8 commit 091a4f6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/plugins/Title/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export interface PluginTitleProps extends PluginWidgetProps {

const b = cn('dashkit-plugin-title');

export const PluginTitle = React.forwardRef<HTMLDivElement, PluginTitleProps>(
function PluginTitleForwardRef(props, ref) {
const {data} = props;
export class PluginTitle extends React.Component<PluginTitleProps> {
render() {
const {data} = this.props;
const text = data.text ? data.text : '';

const size = isCustomSize(data.size) ? false : data.size;
Expand All @@ -38,7 +38,6 @@ export const PluginTitle = React.forwardRef<HTMLDivElement, PluginTitleProps>(

return (
<div
ref={ref}
id={id}
style={styles}
className={b({size})}
Expand All @@ -47,8 +46,8 @@ export const PluginTitle = React.forwardRef<HTMLDivElement, PluginTitleProps>(
{text}
</div>
);
},
);
}
}

const plugin: Plugin<PluginTitleProps> = {
type: 'title',
Expand Down

0 comments on commit 091a4f6

Please sign in to comment.