Browse Source

ref(js): Convert ValueComponent to a FC (#34620)

Evan Purkhiser 2 years ago
parent
commit
88f245be2e
1 changed files with 8 additions and 14 deletions
  1. 8 14
      static/app/components/selectMembers/valueComponent.tsx

+ 8 - 14
static/app/components/selectMembers/valueComponent.tsx

@@ -1,5 +1,3 @@
-import {Component} from 'react';
-
 import ActorAvatar from 'sentry/components/avatar/actorAvatar';
 import {Actor} from 'sentry/types';
 
@@ -12,16 +10,12 @@ type Props = {
   value: Value;
 };
 
-export default class ValueComponent extends Component<Props> {
-  handleClick = () => {
-    this.props.onRemove(this.props.value);
-  };
-
-  render() {
-    return (
-      <a onClick={this.handleClick}>
-        <ActorAvatar actor={this.props.value.actor} size={28} />
-      </a>
-    );
-  }
+function ValueComponent({value, onRemove}: Props) {
+  return (
+    <a onClick={() => onRemove(value)}>
+      <ActorAvatar actor={value.actor} size={28} />
+    </a>
+  );
 }
+
+export default ValueComponent;