From fe2f7f16945a382e8fa9bc4032a5e21bfa4c8ba0 Mon Sep 17 00:00:00 2001 From: Abhay Kumar Date: Sun, 16 Apr 2023 15:19:48 +0530 Subject: [PATCH] Fix #150: Disable Go button until input is filled --- app/components/UrlForm.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/components/UrlForm.tsx b/app/components/UrlForm.tsx index 6a57616b..8bcc161b 100644 --- a/app/components/UrlForm.tsx +++ b/app/components/UrlForm.tsx @@ -1,3 +1,4 @@ +import { useState } from "react"; import { Form } from "remix"; export type UrlFormProps = { @@ -5,6 +6,10 @@ export type UrlFormProps = { }; export function UrlForm({ className }: UrlFormProps) { + const [inputValue, setInputValue] = useState(""); + + const isButtonDisabled = !inputValue.length; + return (
setInputValue(event.target.value)} />