Skip to content

Commit f3009f5

Browse files
committed
Merge branch 'release-next'
2 parents 9ed384c + d405320 commit f3009f5

File tree

27 files changed

+386
-105
lines changed

27 files changed

+386
-105
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
33
"changelog": [
4-
"@changesets/cli/changelog",
4+
"@remix-run/changelog-github",
55
{ "repo": "remix-run/react-router" }
66
],
77
"commit": false,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ node_modules/
2222
/packages/react-router-dom-v5-compat/react-router-dom
2323

2424
.eslintcache
25+
/.env

contributors.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
- alany411
44
- alexlbr
55
- AmRo045
6+
- andreiduca
67
- avipatel97
78
- awreese
89
- aymanemadidi
9-
- aymanemadidi
1010
- bavardage
1111
- bhbs
1212
- BrianT1414
@@ -33,7 +33,6 @@
3333
- fz6m
3434
- gianlucca
3535
- gijo-varghese
36-
- gijo-varghese
3736
- goldins
3837
- gowthamvbhat
3938
- GraxMonzo
@@ -47,6 +46,7 @@
4746
- infoxicator
4847
- IsaiStormBlesed
4948
- Isammoc
49+
- jacob-ebey
5050
- JaffParker
5151
- JakubDrozd
5252
- janpaepke
@@ -68,6 +68,7 @@
6868
- lukerSpringTree
6969
- marc2332
7070
- markivancho
71+
- marvinruder
7172
- maxpou
7273
- mcansh
7374
- MenouerBetty

docs/start/overview.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ createBrowserRouter(
6666
<Route
6767
path="dashboard"
6868
element={<Dashboard />}
69-
loader={fetch("/api/dashboard.json", {
70-
signal: request.signal,
71-
})}
69+
loader={({ request }) =>
70+
fetch("/api/dashboard.json", {
71+
signal: request.signal,
72+
})
73+
}
7274
/>
7375
<Route element={<AuthLayout />}>
7476
<Route
@@ -406,7 +408,9 @@ function Issue() {
406408
{/* Await manages the deferred data (promise) */}
407409
<Await resolve={history}>
408410
{/* this calls back when the data is resolved */}
409-
{(history) => <IssueHistory history={history} />}
411+
{(resolvedHistory) => (
412+
<IssueHistory history={resolvedHistory} />
413+
)}
410414
</Await>
411415
</Suspense>
412416

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@octokit/graphql": "^4.8.0",
5353
"@octokit/plugin-paginate-rest": "^2.17.0",
5454
"@octokit/rest": "^18.12.0",
55+
"@remix-run/changelog-github": "^0.0.5",
5556
"@remix-run/web-fetch": "4.1.3",
5657
"@rollup/plugin-babel": "^5.3.1",
5758
"@rollup/plugin-replace": "^4.0.0",
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
# react-router-dom-v5-compat
1+
# `react-router-dom-v5-compat`
2+
3+
## 6.4.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
9+
210

311
## 6.4.0
412

513
**Updated dependencies**
614

7-
8-
15+
16+

packages/react-router-dom-v5-compat/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-dom-v5-compat",
3-
"version": "6.4.0",
3+
"version": "6.4.1",
44
"description": "Migration path to React Router v6 from v4/5",
55
"keywords": [
66
"react",
@@ -24,12 +24,12 @@
2424
"types": "./dist/index.d.ts",
2525
"dependencies": {
2626
"history": "^5.3.0",
27-
"react-router": "6.4.0"
27+
"react-router": "6.4.1"
2828
},
2929
"peerDependencies": {
3030
"react": ">=16.8",
3131
"react-dom": ">=16.8",
32-
"react-router-dom": "4 || 5"
32+
"react-router-dom": "6.4.1"
3333
},
3434
"files": [
3535
"dist/",

packages/react-router-dom/CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# react-router-dom
1+
# `react-router-dom`
2+
3+
## 6.4.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
9+
- `@remix-run/[email protected]`
210

311
## 6.4.0
412

@@ -27,7 +35,7 @@ Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs ov
2735

2836
**Updated Dependencies**
2937

30-
38+
3139

3240
[rr-docs]: https://reactrouter.com/
3341
[rr-feature-overview]: https://reactrouter.com/en/6.4.0/start/overview

packages/react-router-dom/__tests__/data-browser-router-test.tsx

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,6 +2270,93 @@ function testDomRouter(
22702270
`);
22712271
});
22722272

2273+
it("handles fetcher ?index params", async () => {
2274+
let { container } = render(
2275+
<TestDataRouter
2276+
window={getWindow("/parent")}
2277+
hydrationData={{ loaderData: { parent: null, index: null } }}
2278+
>
2279+
<Route
2280+
path="/parent"
2281+
element={<Outlet />}
2282+
action={() => "PARENT ACTION"}
2283+
loader={() => "PARENT LOADER"}
2284+
>
2285+
<Route
2286+
index
2287+
element={<Index />}
2288+
action={() => "INDEX ACTION"}
2289+
loader={() => "INDEX LOADER"}
2290+
/>
2291+
</Route>
2292+
</TestDataRouter>
2293+
);
2294+
2295+
function Index() {
2296+
let fetcher = useFetcher();
2297+
2298+
return (
2299+
<>
2300+
<p id="output">{fetcher.data}</p>
2301+
<button onClick={() => fetcher.load("/parent")}>
2302+
Load parent
2303+
</button>
2304+
<button onClick={() => fetcher.load("/parent?index")}>
2305+
Load index
2306+
</button>
2307+
<button onClick={() => fetcher.submit({})}>Submit empty</button>
2308+
<button
2309+
onClick={() =>
2310+
fetcher.submit({}, { method: "get", action: "/parent" })
2311+
}
2312+
>
2313+
Submit parent get
2314+
</button>
2315+
<button
2316+
onClick={() =>
2317+
fetcher.submit({}, { method: "get", action: "/parent?index" })
2318+
}
2319+
>
2320+
Submit index get
2321+
</button>
2322+
<button
2323+
onClick={() =>
2324+
fetcher.submit({}, { method: "post", action: "/parent" })
2325+
}
2326+
>
2327+
Submit parent post
2328+
</button>
2329+
<button
2330+
onClick={() =>
2331+
fetcher.submit(
2332+
{},
2333+
{ method: "post", action: "/parent?index" }
2334+
)
2335+
}
2336+
>
2337+
Submit index post
2338+
</button>
2339+
</>
2340+
);
2341+
}
2342+
2343+
async function clickAndAssert(btnText: string, expectedOutput: string) {
2344+
fireEvent.click(screen.getByText(btnText));
2345+
await waitFor(() => screen.getByText(new RegExp(expectedOutput)));
2346+
expect(getHtml(container.querySelector("#output"))).toContain(
2347+
expectedOutput
2348+
);
2349+
}
2350+
2351+
await clickAndAssert("Load parent", "PARENT LOADER");
2352+
await clickAndAssert("Load index", "INDEX LOADER");
2353+
await clickAndAssert("Submit empty", "INDEX LOADER");
2354+
await clickAndAssert("Submit parent get", "PARENT LOADER");
2355+
await clickAndAssert("Submit index get", "INDEX LOADER");
2356+
await clickAndAssert("Submit parent post", "PARENT ACTION");
2357+
await clickAndAssert("Submit index post", "INDEX ACTION");
2358+
});
2359+
22732360
it("handles fetcher.load errors", async () => {
22742361
let { container } = render(
22752362
<TestDataRouter

packages/react-router-dom/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export type {
7474
ActionFunction,
7575
ActionFunctionArgs,
7676
AwaitProps,
77-
DataMemoryRouterProps,
7877
DataRouteMatch,
7978
DataRouteObject,
8079
Fetcher,

0 commit comments

Comments
 (0)