1
0
Fork 0

Possible small optimization for name-text

This commit is contained in:
Lim Chee Aun 2023-09-09 14:25:53 +08:00
parent 8018d06cdf
commit fea1d77342

View file

@ -1,5 +1,7 @@
import './name-text.css';
import { memo } from 'preact/compat';
import states from '../utils/states';
import Avatar from './avatar';
@ -43,6 +45,7 @@ function NameText({
onClick={(e) => {
if (external) return;
e.preventDefault();
e.stopPropagation();
if (onClick) return onClick(e);
states.showAccount = {
account,
@ -85,4 +88,4 @@ function NameText({
);
}
export default NameText;
export default memo(NameText);