Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export PathParam type #10719

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/cyan-knives-shake.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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