From 9dd86f9f603f476ececc83f0a28a8889c37c9c61 Mon Sep 17 00:00:00 2001 From: patrickwebsdev Date: Sat, 9 Nov 2024 03:29:02 -0300 Subject: [PATCH] fix: React Hook "useSession" is called conditionally. React Hooks must be called in the exact same order in every component render. react-hooks/rules-of-hooks --- src/components/OfferHelp.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/OfferHelp.js b/src/components/OfferHelp.js index 750143d..2fa76e8 100644 --- a/src/components/OfferHelp.js +++ b/src/components/OfferHelp.js @@ -26,7 +26,8 @@ export default function OfferHelp({ sessionProp, }) { const { towns } = useTowns(); - const session = sessionProp || useSession(); + const sessionProvider = useSession(); + const session = sessionProp || sessionProvider; const router = useRouter();