From a74f86505b9a2b4f2af956c88cf5e799e7fe0231 Mon Sep 17 00:00:00 2001 From: Uri Kutner Date: Mon, 8 Nov 2021 19:27:27 +0200 Subject: [PATCH 1/6] forward history package --- packages/react-router-dom/index.tsx | 1 + packages/react-router/index.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/react-router-dom/index.tsx b/packages/react-router-dom/index.tsx index eb74683ea4..3dff8de115 100644 --- a/packages/react-router-dom/index.tsx +++ b/packages/react-router-dom/index.tsx @@ -1,4 +1,5 @@ import * as React from "react"; +export * as History from "history"; import type { BrowserHistory, HashHistory } from "history"; import { createBrowserHistory, createHashHistory, createPath } from "history"; import { diff --git a/packages/react-router/index.tsx b/packages/react-router/index.tsx index 3567e377ab..7603094754 100644 --- a/packages/react-router/index.tsx +++ b/packages/react-router/index.tsx @@ -13,6 +13,7 @@ import { parsePath } from "history"; +export * as History from "history"; // forward history export type { Location, Path, To, NavigationType }; function invariant(cond: any, message: string): asserts cond { From 2852f097bfd769e1fed7b1210ee2dfc97bb2b316 Mon Sep 17 00:00:00 2001 From: Uri Kutner Date: Mon, 8 Nov 2021 19:28:32 +0200 Subject: [PATCH 2/6] comment --- packages/react-router-dom/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-router-dom/index.tsx b/packages/react-router-dom/index.tsx index 3dff8de115..e5a7775494 100644 --- a/packages/react-router-dom/index.tsx +++ b/packages/react-router-dom/index.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -export * as History from "history"; +export * as History from "history"; // forward history import type { BrowserHistory, HashHistory } from "history"; import { createBrowserHistory, createHashHistory, createPath } from "history"; import { From 42e89229755ea711e31b0ca2e70efafcd632084b Mon Sep 17 00:00:00 2001 From: Uri Kutner Date: Tue, 11 Jan 2022 12:35:49 +0200 Subject: [PATCH 3/6] forward specific exports from history --- packages/react-router-dom/index.tsx | 9 +++++++-- packages/react-router/index.tsx | 10 +++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/react-router-dom/index.tsx b/packages/react-router-dom/index.tsx index d99bfb30a6..113c763fa3 100644 --- a/packages/react-router-dom/index.tsx +++ b/packages/react-router-dom/index.tsx @@ -1,8 +1,8 @@ import * as React from "react"; -export * as History from "history"; // forward history import type { BrowserHistory, HashHistory, History } from "history"; -import { createBrowserHistory, createHashHistory, createPath } from "history"; +import { createBrowserHistory, createHashHistory } from "history"; import { + createPath, MemoryRouter, Navigate, Outlet, @@ -13,6 +13,7 @@ import { generatePath, matchRoutes, matchPath, + parsePath, resolvePath, renderMatches, useHref, @@ -52,6 +53,7 @@ function warning(cond: boolean, message: string): void { // Note: Keep in sync with react-router exports! export { + createPath, MemoryRouter, Navigate, Outlet, @@ -62,6 +64,7 @@ export { generatePath, matchRoutes, matchPath, + parsePath, renderMatches, resolvePath, useHref, @@ -78,6 +81,7 @@ export { }; export type { + Hash, Location, Path, To, @@ -97,6 +101,7 @@ export type { LayoutRouteProps, IndexRouteProps, RouterProps, + Pathname, RoutesProps } from "react-router"; diff --git a/packages/react-router/index.tsx b/packages/react-router/index.tsx index f93fc08200..8de8832e33 100644 --- a/packages/react-router/index.tsx +++ b/packages/react-router/index.tsx @@ -1,20 +1,24 @@ import * as React from "react"; import type { + Hash, History, InitialEntry, Location, MemoryHistory, Path, + Pathname, + Search, To } from "history"; import { Action as NavigationType, createMemoryHistory, - parsePath + parsePath, + createPath } from "history"; -export * as History from "history"; // forward history -export type { Location, Path, To, NavigationType }; +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); From eee0f4447d21317dd0ebf2c2527358c9b9603001 Mon Sep 17 00:00:00 2001 From: Uri Kutner Date: Sun, 27 Feb 2022 12:09:06 +0200 Subject: [PATCH 4/6] add search type to react-router exports --- packages/react-router-dom/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-router-dom/index.tsx b/packages/react-router-dom/index.tsx index 1395b16cc4..297134f9f9 100644 --- a/packages/react-router-dom/index.tsx +++ b/packages/react-router-dom/index.tsx @@ -2,7 +2,6 @@ import * as React from "react"; import type { BrowserHistory, HashHistory, History } from "history"; import { createBrowserHistory, createHashHistory } from "history"; import { - createPath, MemoryRouter, Navigate, Outlet, @@ -13,6 +12,7 @@ import { generatePath, matchRoutes, matchPath, + createPath, parsePath, resolvePath, renderMatches, @@ -53,7 +53,6 @@ function warning(cond: boolean, message: string): void { // Note: Keep in sync with react-router exports! export { - createPath, MemoryRouter, Navigate, Outlet, @@ -64,6 +63,7 @@ export { generatePath, matchRoutes, matchPath, + createPath, parsePath, renderMatches, resolvePath, @@ -102,6 +102,7 @@ export type { IndexRouteProps, RouterProps, Pathname, + Search, RoutesProps } from "react-router"; From 13e5051e7164029171a2964978c9729dec961725 Mon Sep 17 00:00:00 2001 From: Uri Kutner Date: Mon, 28 Feb 2022 12:15:30 +0200 Subject: [PATCH 5/6] added myself as a contributor --- contributors.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.yml b/contributors.yml index 49f728fbcc..8c8139b864 100644 --- a/contributors.yml +++ b/contributors.yml @@ -23,3 +23,4 @@ - timdorr - turansky - vijaypushkin +- KutnerUri From 90f806ed91bf8fa0cdbb32924745342b13f7bd1c Mon Sep 17 00:00:00 2001 From: Uri Kutner Date: Mon, 28 Feb 2022 16:22:29 +0200 Subject: [PATCH 6/6] fix --- packages/react-router-native/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-router-native/index.tsx b/packages/react-router-native/index.tsx index 05b1329d8a..aacd2b402f 100644 --- a/packages/react-router-native/index.tsx +++ b/packages/react-router-native/index.tsx @@ -19,6 +19,8 @@ import { generatePath, matchRoutes, matchPath, + createPath, + parsePath, resolvePath, renderMatches, useHref, @@ -53,6 +55,8 @@ export { generatePath, matchRoutes, matchPath, + createPath, + parsePath, resolvePath, renderMatches, useHref, @@ -70,6 +74,7 @@ export { export { NavigationType } from "react-router"; export type { + Hash, IndexRouteProps, LayoutRouteProps, Location, @@ -88,6 +93,8 @@ export type { RouteProps, RouterProps, RoutesProps, + Pathname, + Search, To, } from "react-router";