From 9a427f4b9fe00a8fb7492b8f5d098cd243d7dbcb Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 12 Apr 2026 17:23:08 +0300 Subject: [PATCH] chore(client): dev server not working due to prefresh bug See https://github.com/preactjs/prefresh/issues/610 --- apps/client/src/widgets/react/Button.tsx | 5 ++--- apps/client/src/widgets/react/Modal.tsx | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/client/src/widgets/react/Button.tsx b/apps/client/src/widgets/react/Button.tsx index 6269000563..3114b9dfe8 100644 --- a/apps/client/src/widgets/react/Button.tsx +++ b/apps/client/src/widgets/react/Button.tsx @@ -1,5 +1,4 @@ import type { ComponentChildren, CSSProperties, RefObject } from "preact"; -import { memo } from "preact/compat"; import { useMemo } from "preact/hooks"; import { CommandNames } from "../../components/app_context"; @@ -27,7 +26,7 @@ export interface ButtonProps { title?: string; } -const Button = memo(({ name, buttonRef, className, text, onClick, keyboardShortcut, icon, kind, disabled, size, style, triggerCommand, ...restProps }: ButtonProps) => { +function Button({ name, buttonRef, className, text, onClick, keyboardShortcut, icon, kind, disabled, size, style, triggerCommand, ...restProps }: ButtonProps) { // Memoize classes array to prevent recreation const classes = useMemo(() => { const classList: string[] = ["btn"]; @@ -83,7 +82,7 @@ const Button = memo(({ name, buttonRef, className, text, onClick, keyboardShortc {text} {shortcutElements} ); -}); +} export function ButtonGroup({ children }: { children: ComponentChildren }) { return ( diff --git a/apps/client/src/widgets/react/Modal.tsx b/apps/client/src/widgets/react/Modal.tsx index e7a7c721f8..bd1c052ab7 100644 --- a/apps/client/src/widgets/react/Modal.tsx +++ b/apps/client/src/widgets/react/Modal.tsx @@ -1,7 +1,6 @@ import { Modal as BootstrapModal } from "bootstrap"; import clsx from "clsx"; import { ComponentChildren, CSSProperties, RefObject } from "preact"; -import { memo } from "preact/compat"; import { useEffect, useMemo, useRef } from "preact/hooks"; import { openDialog } from "../../services/dialog"; @@ -186,7 +185,7 @@ export default function Modal({ children, className, size, title, customTitleBar ); } -const ModalInner = memo(({ children, footer, footerAlignment, bodyStyle, footerStyle: _footerStyle }: Pick) => { +function ModalInner({ children, footer, footerAlignment, bodyStyle, footerStyle: _footerStyle }: Pick) { // Memoize footer style const footerStyle = useMemo(() => { const style: CSSProperties = _footerStyle ?? {}; @@ -209,4 +208,4 @@ const ModalInner = memo(({ children, footer, footerAlignment, bodyStyle, footerS )} ); -}); +}