Skip to content

Commit a3f3320

Browse files
committed
In href(), check params["*"] against not null instead of truthy
1 parent a89c1cc commit a3f3320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-router/lib/href.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function href<Path extends keyof Args>(
4444
// treat trailing splat the same way as compilePath, and force it to be as if it were `/*`.
4545
// `react-router typegen` will not generate the params for a malformed splat, causing a type error, but we can still do the correct thing here.
4646
result = result.slice(0, result.endsWith("/*") ? -2 : -1);
47-
if (params && params["*"]) {
47+
if (params && params["*"] != null) {
4848
result += "/" + params["*"];
4949
}
5050
}

0 commit comments

Comments
 (0)