-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Wrap route with location arg in location context (#9094)
* Wrap route with location arg in location context In order for the `useLocation` hook to work with the use of the modal pattern, routes with the locationArg prop are wrapped in a LocationContext. This is done conditionally in order to ensure performance in the default case doesn't change. * Update useLocation unit tests * Remove static markup from test for brevity * Back out formatting change to test Co-authored-by: John Pangalos <john@juni.co> Co-authored-by: Matt Brophy <matt@brophy.org>
- Loading branch information
1 parent
e13e1f9
commit e766ab5
Showing
3 changed files
with
75 additions
and
7 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,8 @@ | ||
--- | ||
"react-router": patch | ||
"react-router-dom": patch | ||
"react-router-dom-v5-compat": patch | ||
"react-router-native": patch | ||
--- | ||
|
||
fix: update `useLocation` to return the scoped `Location` when inside a `<Routes location>` component |
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