From 066abec9372f277b0d30286e6665899de3cc3b44 Mon Sep 17 00:00:00 2001 From: cha0s Date: Wed, 2 Oct 2024 15:12:14 -0500 Subject: [PATCH] perf: memo --- app/react/components/dom/time.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/react/components/dom/time.jsx b/app/react/components/dom/time.jsx index 6fa0d92..118e522 100644 --- a/app/react/components/dom/time.jsx +++ b/app/react/components/dom/time.jsx @@ -1,4 +1,4 @@ -import {useCallback, useState} from 'react'; +import {memo, useCallback, useState} from 'react'; import {useEcsTick} from '@/react/context/ecs.js'; @@ -19,6 +19,8 @@ export function Time({hour, minute}) { ); } +const MemoTime = memo(Time); + function ConnectedTime() { const [hour, setHour] = useState(-1); const [minute, setMinute] = useState(0); @@ -35,7 +37,7 @@ function ConnectedTime() { if (-1 === hour) { return false; } - return