-
-
Notifications
You must be signed in to change notification settings - Fork 734
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react-router): fix re-rendering when loaderDeps change (#2752)
* fix(react-router): correct cause for loader see #2749 * stable loaderdeps and search * allow narrowing on the router state matches * structural sharing for params, search and loader deps * avoid re-rendering if matchId changes although we don't care for the matchId
- Loading branch information
1 parent
ee0a9fc
commit ee74d19
Showing
3 changed files
with
31 additions
and
14 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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
import * as React from 'react' | ||
|
||
export const matchContext = React.createContext<string | undefined>(undefined) | ||
|
||
// N.B. this only exists so we can conditionally call useContext on it when we are not interested in the nearest match | ||
export const dummyMatchContext = React.createContext<string | undefined>( | ||
undefined, | ||
) |
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