From 538956ea9a6a9313b105fcaaf45080cdf51c7c80 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Fri, 18 Oct 2024 14:09:55 -0700 Subject: [PATCH] use fragment --- frontend/app/view/webview/webview.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/app/view/webview/webview.tsx b/frontend/app/view/webview/webview.tsx index d62ec7be1..daf7bee39 100644 --- a/frontend/app/view/webview/webview.tsx +++ b/frontend/app/view/webview/webview.tsx @@ -13,7 +13,7 @@ import { fireAndForget } from "@/util/util"; import clsx from "clsx"; import { WebviewTag } from "electron"; import { Atom, PrimitiveAtom, atom, useAtomValue } from "jotai"; -import React, { memo, useEffect, useState } from "react"; +import { Fragment, createRef, memo, useEffect, useRef, useState } from "react"; import "./webview.less"; let webviewPreloadUrl = null; @@ -76,8 +76,8 @@ export class WebViewModel implements ViewModel { this.refreshIcon = atom("rotate-right"); this.viewIcon = atom("globe"); this.viewName = atom("Web"); - this.urlInputRef = React.createRef(); - this.webviewRef = React.createRef(); + this.urlInputRef = createRef(); + this.webviewRef = createRef(); this.mediaPlaying = atom(false); this.mediaMuted = atom(false); @@ -485,7 +485,7 @@ const WebView = memo(({ model, onFailLoad }: WebViewProps) => { const defaultSearch = useAtomValue(defaultSearchAtom); let metaUrl = blockData?.meta?.url || defaultUrl; metaUrl = model.ensureUrlScheme(metaUrl, defaultSearch); - const metaUrlRef = React.useRef(metaUrl); + const metaUrlRef = useRef(metaUrl); // The initial value of the block metadata URL when the component first renders. Used to set the starting src value for the webview. const [metaUrlInitial] = useState(metaUrl); @@ -624,7 +624,7 @@ const WebView = memo(({ model, onFailLoad }: WebViewProps) => { }, []); return ( - <> + {
{errorText}
)} - +
); });