Skip to content

Commit

Permalink
feat: export PathParam type
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkoops committed Oct 3, 2023
1 parent f77743a commit c2d5c0e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .changeset/cyan-knives-shake.md
@@ -0,0 +1,9 @@
---
"react-router-dom-v5-compat": minor
"react-router-native": minor
"react-router-dom": minor
"react-router": minor
"@remix-run/router": minor
---

Export the `PathParam` type from the public API
1 change: 1 addition & 0 deletions packages/react-router-dom-v5-compat/index.ts
Expand Up @@ -85,6 +85,7 @@ export type {
Params,
Path,
PathMatch,
PathParam,
PathPattern,
PathRouteProps,
Pathname,
Expand Down
1 change: 1 addition & 0 deletions packages/react-router-dom/index.tsx
Expand Up @@ -116,6 +116,7 @@ export type {
Path,
PathMatch,
Pathname,
PathParam,
PathPattern,
PathRouteProps,
RedirectFunction,
Expand Down
1 change: 1 addition & 0 deletions packages/react-router-native/index.tsx
Expand Up @@ -51,6 +51,7 @@ export type {
Path,
PathMatch,
Pathname,
PathParam,
PathPattern,
PathRouteProps,
RedirectFunction,
Expand Down
2 changes: 2 additions & 0 deletions packages/react-router/index.ts
Expand Up @@ -18,6 +18,7 @@ import type {
Params,
Path,
PathMatch,
PathParam,
PathPattern,
RedirectFunction,
RelativeRoutingType,
Expand Down Expand Up @@ -153,6 +154,7 @@ export type {
Params,
Path,
PathMatch,
PathParam,
PathPattern,
PathRouteProps,
Pathname,
Expand Down
1 change: 1 addition & 0 deletions packages/router/index.ts
Expand Up @@ -20,6 +20,7 @@ export type {
ParamParseKey,
Params,
PathMatch,
PathParam,
PathPattern,
RedirectFunction,
ShouldRevalidateFunction,
Expand Down
2 changes: 1 addition & 1 deletion packages/router/utils.ts
Expand Up @@ -349,7 +349,7 @@ type _PathParam<Path extends string> =
* "/:a/:b" -> "a" | "b"
* "/:a/b/:c/*" -> "a" | "c" | "*"
*/
type PathParam<Path extends string> =
export type PathParam<Path extends string> =
// check if path is just a wildcard
Path extends "*" | "/*"
? "*"
Expand Down

0 comments on commit c2d5c0e

Please sign in to comment.