Skip to content

Commit 3f6bc1b

Browse files
authored
feat: forward parsePath and createPath from history (#8278)
1 parent 5131627 commit 3f6bc1b

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424
- timdorr
2525
- turansky
2626
- vijaypushkin
27+
- KutnerUri

packages/react-router-dom/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from "react";
22
import type { BrowserHistory, HashHistory, History } from "history";
3-
import { createBrowserHistory, createHashHistory, createPath } from "history";
3+
import { createBrowserHistory, createHashHistory } from "history";
44
import {
55
MemoryRouter,
66
Navigate,
@@ -12,6 +12,8 @@ import {
1212
generatePath,
1313
matchRoutes,
1414
matchPath,
15+
createPath,
16+
parsePath,
1517
resolvePath,
1618
renderMatches,
1719
useHref,
@@ -61,6 +63,8 @@ export {
6163
generatePath,
6264
matchRoutes,
6365
matchPath,
66+
createPath,
67+
parsePath,
6468
renderMatches,
6569
resolvePath,
6670
useHref,
@@ -78,6 +82,7 @@ export {
7882

7983
export { NavigationType } from "react-router";
8084
export type {
85+
Hash,
8186
Location,
8287
Path,
8388
To,
@@ -96,7 +101,9 @@ export type {
96101
LayoutRouteProps,
97102
IndexRouteProps,
98103
RouterProps,
99-
RoutesProps,
104+
Pathname,
105+
Search,
106+
RoutesProps
100107
} from "react-router";
101108

102109
///////////////////////////////////////////////////////////////////////////////

packages/react-router-native/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
generatePath,
2020
matchRoutes,
2121
matchPath,
22+
createPath,
23+
parsePath,
2224
resolvePath,
2325
renderMatches,
2426
useHref,
@@ -53,6 +55,8 @@ export {
5355
generatePath,
5456
matchRoutes,
5557
matchPath,
58+
createPath,
59+
parsePath,
5660
resolvePath,
5761
renderMatches,
5862
useHref,
@@ -70,6 +74,7 @@ export {
7074

7175
export { NavigationType } from "react-router";
7276
export type {
77+
Hash,
7378
IndexRouteProps,
7479
LayoutRouteProps,
7580
Location,
@@ -88,6 +93,8 @@ export type {
8893
RouteProps,
8994
RouterProps,
9095
RoutesProps,
96+
Pathname,
97+
Search,
9198
To,
9299
} from "react-router";
93100

packages/react-router/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import * as React from "react";
22
import type {
3+
Hash,
34
History,
45
InitialEntry,
56
Location,
67
MemoryHistory,
78
Path,
8-
To,
9+
Pathname,
10+
Search,
11+
To
912
} from "history";
1013
import {
1114
Action as NavigationType,
1215
createMemoryHistory,
1316
parsePath,
17+
createPath
1418
} from "history";
1519

16-
export { NavigationType };
17-
export type { Location, Path, To };
20+
export { parsePath, createPath, NavigationType };
21+
export type { Hash, Location, Path, Pathname, Search, To };
1822

1923
function invariant(cond: any, message: string): asserts cond {
2024
if (!cond) throw new Error(message);

0 commit comments

Comments
 (0)