* #24774 Converted ./plugins/rhs_plugin/rhs_plugin.tsx to Function Component * Fixed the lint errors and removed explicit FC type * Added memo to make the functional component pure.
Этот коммит содержится в:
@@ -13,26 +13,24 @@ export type Props = {
|
|||||||
title: React.ReactNode;
|
title: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class RhsPlugin extends React.PureComponent<Props> {
|
const RhsPlugin = ({showPluggable, pluggableId, title}: Props) => {
|
||||||
render() {
|
return (
|
||||||
return (
|
<div
|
||||||
<div
|
id='rhsContainer'
|
||||||
id='rhsContainer'
|
className='sidebar-right__body'
|
||||||
className='sidebar-right__body'
|
>
|
||||||
>
|
<SearchResultsHeader>
|
||||||
<SearchResultsHeader>
|
{title}
|
||||||
{this.props.title}
|
</SearchResultsHeader>
|
||||||
</SearchResultsHeader>
|
{
|
||||||
{
|
showPluggable &&
|
||||||
this.props.showPluggable &&
|
<Pluggable
|
||||||
<>
|
pluggableName='RightHandSidebarComponent'
|
||||||
<Pluggable
|
pluggableId={pluggableId}
|
||||||
pluggableName='RightHandSidebarComponent'
|
/>
|
||||||
pluggableId={this.props.pluggableId}
|
}
|
||||||
/>
|
</div>
|
||||||
</>
|
);
|
||||||
}
|
};
|
||||||
</div>
|
|
||||||
);
|
export default React.memo(RhsPlugin);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user