Skip to content

Commit

Permalink
Possible small optimization for name-text
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Sep 9, 2023
1 parent 8018d06 commit fea1d77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/name-text.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import './name-text.css';

import { memo } from 'preact/compat';

import states from '../utils/states';

import Avatar from './avatar';
Expand Down Expand Up @@ -43,6 +45,7 @@ function NameText({
onClick={(e) => {
if (external) return;
e.preventDefault();
e.stopPropagation();
if (onClick) return onClick(e);
states.showAccount = {
account,
Expand Down Expand Up @@ -85,4 +88,4 @@ function NameText({
);
}

export default NameText;
export default memo(NameText);

0 comments on commit fea1d77

Please sign in to comment.