Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@machour
Created November 10, 2022 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machour/870705998b8e14a96171ee2fb85d5921 to your computer and use it in GitHub Desktop.
Save machour/870705998b8e14a96171ee2fb85d5921 to your computer and use it in GitHub Desktop.
Remove nullish coalescing operator from @remix-run/react
diff --git a/node_modules/@remix-run/react/dist/components.js b/node_modules/@remix-run/react/dist/components.js
index f947287..e7cc1f5 100644
--- a/node_modules/@remix-run/react/dist/components.js
+++ b/node_modules/@remix-run/react/dist/components.js
@@ -773,7 +773,7 @@ method = "get") {
let {
id
} = useRemixRouteContext();
- let resolvedPath = reactRouterDom.useResolvedPath(action ?? "."); // Previously we set the default action to ".". The problem with this is that
+ let resolvedPath = reactRouterDom.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
// URL. This is the intended behavior of when "." is specifically provided as
// the form action, but inconsistent w/ browsers when the action is omitted.
diff --git a/node_modules/@remix-run/react/dist/esm/components.js b/node_modules/@remix-run/react/dist/esm/components.js
index e884e7b..d23d86b 100644
--- a/node_modules/@remix-run/react/dist/esm/components.js
+++ b/node_modules/@remix-run/react/dist/esm/components.js
@@ -749,7 +749,7 @@ method = "get") {
let {
id
} = useRemixRouteContext();
- let resolvedPath = useResolvedPath(action ?? "."); // Previously we set the default action to ".". The problem with this is that
+ 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
// URL. This is the intended behavior of when "." is specifically provided as
// the form action, but inconsistent w/ browsers when the action is omitted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment