-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow
<Link>
to link to external urls (#9900)
* feat: allow Link's "to" prop to accept external urls Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: update external link detection to account for no protocol Signed-off-by: Logan McAnsh <logan@mcan.sh> * Update index.tsx * Update index.tsx * chore: update absolute url checking per #9900 (comment) Signed-off-by: Logan McAnsh <logan@mcan.sh> * Create silent-oranges-pay.md * chore: bump bundle size Signed-off-by: Logan McAnsh <logan@mcan.sh> * chore: add browser check Signed-off-by: Logan McAnsh <logan@mcan.sh> * Preserve absolute same origin and don't add listener on external links * chore: bump bundle size Signed-off-by: Logan McAnsh <logan@mcan.sh> Signed-off-by: Logan McAnsh <logan@mcan.sh> Co-authored-by: Matt Brophy <matt@brophy.org>
- Loading branch information
1 parent
2cd8266
commit e9f271d
Showing
4 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"react-router": patch | ||
"react-router-dom": patch | ||
--- | ||
|
||
allow using `<Link>` with external URLs | ||
|
||
```tsx | ||
<Link to="//example.com/some/path"> | ||
<Link to="https://www.currentorigin.com/path"> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters