Skip to content

Commit

Permalink
use nullish check instead of explicit undefined check
Browse files Browse the repository at this point in the history
  • Loading branch information
chaance committed Aug 10, 2022
1 parent bf9e435 commit 9147639
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down

0 comments on commit 9147639

Please sign in to comment.