From 9147639294aafd339b7e8cb96b389b9b80b829dd Mon Sep 17 00:00:00 2001 From: Chance Strickland Date: Wed, 10 Aug 2022 13:19:57 -0700 Subject: [PATCH] use nullish check instead of explicit undefined check --- packages/remix-react/components.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/remix-react/components.tsx b/packages/remix-react/components.tsx index 45e0245c12d..7b89d3d2332 100644 --- a/packages/remix-react/components.tsx +++ b/packages/remix-react/components.tsx @@ -1014,13 +1014,13 @@ export function useFormAction( // https://github.com/remix-run/remix/issues/927 let location = useLocation(); let { search, hash } = resolvedPath; - if (action === undefined) { + if (action == null) { search = location.search; hash = location.hash; } let isIndexRoute = id.endsWith("/index"); - if ((action === undefined || action === ".") && isIndexRoute) { + if ((action == null || action === ".") && isIndexRoute) { search = search ? search.replace(/^\?/, "?index&") : "?index"; }