Skip to content

Commit

Permalink
Bump remix to react-router-dom@6.4.4 (#4668)
Browse files Browse the repository at this point in the history
Co-authored-by: Mehdi Achour <machour@gmail.com>
  • Loading branch information
brophdawg11 and machour committed Dec 2, 2022
1 parent 81bea3f commit c7770aa
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-camels-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Update `@remix-run/react` to use `Router` from `react-router-dom@6.4.4`
6 changes: 6 additions & 0 deletions packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ function Routes() {
// need this component, we can just `renderMatches` from RemixEntry
let { clientRoutes } = useRemixEntryContext();
// fallback to the root if we don't have a match

// TODO: clientRoutes currently errors here since RR 6.4 dropped `signal` as a
// loader argument. But since we're just using <Router> we aren't using any
// loaders in RR so this isn't an issue. We'll get these typings straightened
// out as part of the rendering work.
// @ts-expect-error
let element = useRoutes(clientRoutes) || (clientRoutes[0].element as any);
return element;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"module": "dist/esm/index.js",
"dependencies": {
"history": "^5.3.0",
"react-router-dom": "6.3.0"
"react-router-dom": "6.4.4"
},
"devDependencies": {
"@remix-run/server-runtime": "1.8.0",
Expand Down
1 change: 0 additions & 1 deletion packages/remix-server-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@types/cookie": "^0.4.0",
"@web3-storage/multipart-parser": "^1.0.0",
"cookie": "^0.4.1",
"react-router-dom": "6.3.0",
"set-cookie-parser": "^2.4.8",
"source-map": "^0.7.3"
},
Expand Down
9 changes: 6 additions & 3 deletions packages/remix-server-runtime/routeMatching.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Params, RouteObject } from "react-router"; // TODO: export/import from react-router-dom
import { matchRoutes } from "react-router-dom";
import type { Params, AgnosticRouteObject } from "@remix-run/router";
import { matchRoutes } from "@remix-run/router";

import type { ServerRoute } from "./routes";

Expand All @@ -13,7 +13,10 @@ export function matchServerRoutes(
routes: ServerRoute[],
pathname: string
): RouteMatch<ServerRoute>[] | null {
let matches = matchRoutes(routes as unknown as RouteObject[], pathname);
let matches = matchRoutes(
routes as unknown as AgnosticRouteObject[],
pathname
);
if (!matches) return null;

return matches.map((match) => ({
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-server-runtime/routeModules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Params } from "@remix-run/router";
import type { Location } from "history";
import type { ComponentType } from "react";
import type { Params } from "react-router-dom";

import type { AppLoadContext, AppData } from "./data";
import type { LinkDescriptor } from "./links";
Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6996,7 +6996,7 @@ headers-polyfill@^3.0.4:
resolved "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.0.7.tgz"
integrity sha512-JoLCAdCEab58+2/yEmSnOlficyHFpIl0XJqwu3l+Unkm1gXpFUYsThz6Yha3D6tNhocWkCPfyW0YVIGWFqTi7w==

history@^5.2.0, history@^5.3.0:
history@^5.3.0:
version "5.3.0"
resolved "https://registry.npmjs.org/history/-/history-5.3.0.tgz"
integrity sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==
Expand Down Expand Up @@ -10737,20 +10737,20 @@ react-is@^17.0.1:
resolved "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-router-dom@6.3.0:
version "6.3.0"
resolved "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.3.0.tgz"
integrity sha512-uaJj7LKytRxZNQV8+RbzJWnJ8K2nPsOOEuX7aQstlMZKQT0164C+X2w6bnkqU3sjtLvpd5ojrezAyfZ1+0sStw==
react-router-dom@6.4.4:
version "6.4.4"
resolved "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.4.tgz#4271ec66333c440d1754477e4e6a3a5acb5487f8"
integrity sha512-0Axverhw5d+4SBhLqLpzPhNkmv7gahUwlUVIOrRLGJ4/uwt30JVajVJXqv2Qr/LCwyvHhQc7YyK1Do8a9Jj7qA==
dependencies:
history "^5.2.0"
react-router "6.3.0"
"@remix-run/router" "1.0.4"
react-router "6.4.4"

react-router@6.3.0:
version "6.3.0"
resolved "https://registry.npmjs.org/react-router/-/react-router-6.3.0.tgz"
integrity sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==
react-router@6.4.4:
version "6.4.4"
resolved "https://registry.npmjs.org/react-router/-/react-router-6.4.4.tgz#8e7794f55ccc7050cb03937c87ff3720ce9f8b60"
integrity sha512-SA6tSrUCRfuLWeYsTJDuriRqfFIsrSvuH7SqAJHegx9ZgxadE119rU8oOX/rG5FYEthpdEaEljdjDlnBxvfr+Q==
dependencies:
history "^5.2.0"
"@remix-run/router" "1.0.4"

react@^18.2.0:
version "18.2.0"
Expand Down

0 comments on commit c7770aa

Please sign in to comment.