Skip to content

Commit

Permalink
feat: forward parsePath and createPath from history (#8278)
Browse files Browse the repository at this point in the history
  • Loading branch information
KutnerUri committed Feb 28, 2022
1 parent 5131627 commit 3f6bc1b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Expand Up @@ -24,3 +24,4 @@
- timdorr
- turansky
- vijaypushkin
- KutnerUri
11 changes: 9 additions & 2 deletions packages/react-router-dom/index.tsx
@@ -1,6 +1,6 @@
import * as React from "react";
import type { BrowserHistory, HashHistory, History } from "history";
import { createBrowserHistory, createHashHistory, createPath } from "history";
import { createBrowserHistory, createHashHistory } from "history";
import {
MemoryRouter,
Navigate,
Expand All @@ -12,6 +12,8 @@ import {
generatePath,
matchRoutes,
matchPath,
createPath,
parsePath,
resolvePath,
renderMatches,
useHref,
Expand Down Expand Up @@ -61,6 +63,8 @@ export {
generatePath,
matchRoutes,
matchPath,
createPath,
parsePath,
renderMatches,
resolvePath,
useHref,
Expand All @@ -78,6 +82,7 @@ export {

export { NavigationType } from "react-router";
export type {
Hash,
Location,
Path,
To,
Expand All @@ -96,7 +101,9 @@ export type {
LayoutRouteProps,
IndexRouteProps,
RouterProps,
RoutesProps,
Pathname,
Search,
RoutesProps
} from "react-router";

///////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 7 additions & 0 deletions packages/react-router-native/index.tsx
Expand Up @@ -19,6 +19,8 @@ import {
generatePath,
matchRoutes,
matchPath,
createPath,
parsePath,
resolvePath,
renderMatches,
useHref,
Expand Down Expand Up @@ -53,6 +55,8 @@ export {
generatePath,
matchRoutes,
matchPath,
createPath,
parsePath,
resolvePath,
renderMatches,
useHref,
Expand All @@ -70,6 +74,7 @@ export {

export { NavigationType } from "react-router";
export type {
Hash,
IndexRouteProps,
LayoutRouteProps,
Location,
Expand All @@ -88,6 +93,8 @@ export type {
RouteProps,
RouterProps,
RoutesProps,
Pathname,
Search,
To,
} from "react-router";

Expand Down
10 changes: 7 additions & 3 deletions packages/react-router/index.tsx
@@ -1,20 +1,24 @@
import * as React from "react";
import type {
Hash,
History,
InitialEntry,
Location,
MemoryHistory,
Path,
To,
Pathname,
Search,
To
} from "history";
import {
Action as NavigationType,
createMemoryHistory,
parsePath,
createPath
} from "history";

export { NavigationType };
export type { Location, Path, To };
export { parsePath, createPath, NavigationType };
export type { Hash, Location, Path, Pathname, Search, To };

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

0 comments on commit 3f6bc1b

Please sign in to comment.