* #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;
|
||||
}
|
||||
|
||||
export default class RhsPlugin extends React.PureComponent<Props> {
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
id='rhsContainer'
|
||||
className='sidebar-right__body'
|
||||
>
|
||||
<SearchResultsHeader>
|
||||
{this.props.title}
|
||||
</SearchResultsHeader>
|
||||
{
|
||||
this.props.showPluggable &&
|
||||
<>
|
||||
<Pluggable
|
||||
pluggableName='RightHandSidebarComponent'
|
||||
pluggableId={this.props.pluggableId}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
const RhsPlugin = ({showPluggable, pluggableId, title}: Props) => {
|
||||
return (
|
||||
<div
|
||||
id='rhsContainer'
|
||||
className='sidebar-right__body'
|
||||
>
|
||||
<SearchResultsHeader>
|
||||
{title}
|
||||
</SearchResultsHeader>
|
||||
{
|
||||
showPluggable &&
|
||||
<Pluggable
|
||||
pluggableName='RightHandSidebarComponent'
|
||||
pluggableId={pluggableId}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(RhsPlugin);
|
||||
|
||||
Ссылка в новой задаче
Block a user