From 4145fc8db8ba6a44f42f0a2564a9c1670bd50a71 Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Thu, 10 Nov 2022 16:50:59 +0100 Subject: [PATCH] fix(remix-react): Remove nullish coalescing operator (#4561) --- .changeset/curvy-countries-boil.md | 5 +++++ packages/remix-react/components.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/curvy-countries-boil.md diff --git a/.changeset/curvy-countries-boil.md b/.changeset/curvy-countries-boil.md new file mode 100644 index 00000000000..6e39d6bcc2c --- /dev/null +++ b/.changeset/curvy-countries-boil.md @@ -0,0 +1,5 @@ +--- +"@remix-run/react": patch +--- + +Fixed old browsers compatibility by removing a nullish coalescing operator diff --git a/packages/remix-react/components.tsx b/packages/remix-react/components.tsx index f499bcf8717..1c43538167c 100644 --- a/packages/remix-react/components.tsx +++ b/packages/remix-react/components.tsx @@ -1039,7 +1039,7 @@ export function useFormAction( method: FormMethod = "get" ): string { let { id } = useRemixRouteContext(); - let resolvedPath = useResolvedPath(action ?? "."); + let resolvedPath = useResolvedPath(action ? action : "."); // Previously we set the default action to ".". The problem with this is that // `useResolvedPath(".")` excludes search params and the hash of the resolved