Skip to content

Commit 0f2051e

Browse files
committed
Merge branch 'release-next'
2 parents 39ab0a8 + e79cb77 commit 0f2051e

File tree

72 files changed

+5001
-2111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+5001
-2111
lines changed

contributors.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
- cvbuelow
5050
- damianstasik
5151
- danielberndt
52+
- daniilguit
5253
- dauletbaev
5354
- david-crespo
5455
- decadentsavant
@@ -228,3 +229,7 @@
228229
- yionr
229230
- yuleicul
230231
- zheng-chuang
232+
- swalker326
233+
- smithki
234+
- louis-young
235+
- robbtraister

docs/fetch/redirectDocument.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: redirectDocument
3+
new: true
4+
---
5+
6+
# `redirectDocument`
7+
8+
This is a small wrapper around [`redirect`][redirect] that will trigger a document-level redirect to the new location instead of a client-side navigation.
9+
10+
This is most useful when you have a React Router app living next to a separate app on the same domain and need to redirect from the React Router app to the other app via `window.location` instead of a React Router navigation:
11+
12+
```jsx
13+
import { redirectDocument } from "react-router-dom";
14+
15+
const loader = async () => {
16+
const user = await getUser();
17+
if (!user) {
18+
return redirectDocument("/otherapp/login");
19+
}
20+
return null;
21+
};
22+
```
23+
24+
## Type Declaration
25+
26+
```ts
27+
type RedirectFunction = (
28+
url: string,
29+
init?: number | ResponseInit
30+
) => Response;
31+
```
32+
33+
## `url`
34+
35+
The URL to redirect to.
36+
37+
```js
38+
redirectDocument("/otherapp/login");
39+
```
40+
41+
## `init`
42+
43+
The [Response][response] options to be used in the response.
44+
45+
[response]: https://developer.mozilla.org/en-US/docs/Web/API/Response/Response
46+
[redirect]: ./redirect

docs/guides/contributing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ git checkout dev
3636

3737
Please conform to the issue template and provide a clear path to reproduction with a code example. Best is a pull request with a failing test. Next best is a link to CodeSandbox or repository that illustrates the bug.
3838

39+
## Adding an Example?
40+
41+
Examples can be added directly to the main branch. Create a branch off of your local clone of main. Once you've finished, create a pull request and outline your example.
42+
3943
## Proposing New or Changed API?
4044

4145
Please provide thoughtful comments and some sample code that show what you'd like to do with React Router in your app. It helps the conversation if you can show us how you're limited by the current API first before jumping to a conclusion about what needs to be changed and/or added.

examples/auth/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic-data-router/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/custom-filter-link/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/custom-link/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/custom-query-parsing/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/data-router/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)