From 239207e1d30ec7665eb5c05c6469fcd1df4bf91c Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Sat, 6 Apr 2024 18:25:46 +0300 Subject: [PATCH] fix controller/uncontrolled react warning error --- components/publisher/PublisherInlineForm.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/publisher/PublisherInlineForm.js b/components/publisher/PublisherInlineForm.js index 1956a61..b231520 100644 --- a/components/publisher/PublisherInlineForm.js +++ b/components/publisher/PublisherInlineForm.js @@ -4,8 +4,7 @@ import toast from "react-hot-toast"; import { useRouter } from "next/router"; const PublisherInlineForm = ({ publisherId, initialShiftsPerMonth }) => { - const [desiredShiftsPerMonth, setDesiredShiftsPerMonth] = useState(initialShiftsPerMonth); - const router = useRouter(); + const [desiredShiftsPerMonth, setDesiredShiftsPerMonth] = useState(initialShiftsPerMonth || 2); const storedValue = useRef(initialShiftsPerMonth); useEffect(() => {