From 38bafc71b48781438bb7ae8d58003089abc0ffdd Mon Sep 17 00:00:00 2001 From: Koper Date: Tue, 26 Sep 2023 14:34:55 +0100 Subject: [PATCH] Fixed "Controlling an input with a state variable " error See https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable --- www/app/transcripts/shareLink.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/app/transcripts/shareLink.tsx b/www/app/transcripts/shareLink.tsx index 912f1e8b..ea64c9e3 100644 --- a/www/app/transcripts/shareLink.tsx +++ b/www/app/transcripts/shareLink.tsx @@ -3,7 +3,7 @@ import React, { useState, useRef, useEffect, use } from "react"; const ShareLink = () => { const [isCopied, setIsCopied] = useState(false); const inputRef = useRef(null); - const [currentUrl, setCurrentUrl] = useState(); + const [currentUrl, setCurrentUrl] = useState(""); useEffect(() => { setCurrentUrl(window.location.href); @@ -36,6 +36,7 @@ const ShareLink = () => { readOnly value={currentUrl} ref={inputRef} + onChange={() => {}} className="border rounded-lg md:rounded-xl p-2 flex-grow mr-2 text-sm bg-slate-100 outline-slate-400" />