From 2b2743d9cbaff3562b5fd70c73b59548d1d58e0c Mon Sep 17 00:00:00 2001 From: Balaji K Date: Tue, 17 Oct 2023 14:12:36 +0530 Subject: [PATCH] #24774 Converted ./plugins/rhs_plugin/rhs_plugin.tsx to Function Component (#24802) * #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. --- .../src/plugins/rhs_plugin/rhs_plugin.tsx | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/webapp/channels/src/plugins/rhs_plugin/rhs_plugin.tsx b/webapp/channels/src/plugins/rhs_plugin/rhs_plugin.tsx index 80408e8ec4..0703543525 100644 --- a/webapp/channels/src/plugins/rhs_plugin/rhs_plugin.tsx +++ b/webapp/channels/src/plugins/rhs_plugin/rhs_plugin.tsx @@ -13,26 +13,24 @@ export type Props = { title: React.ReactNode; } -export default class RhsPlugin extends React.PureComponent { - render() { - return ( -
- - {this.props.title} - - { - this.props.showPluggable && - <> - - - } -
- ); - } -} +const RhsPlugin = ({showPluggable, pluggableId, title}: Props) => { + return ( +
+ + {title} + + { + showPluggable && + + } +
+ ); +}; + +export default React.memo(RhsPlugin);