generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Deprecate subscribeToQueryUpdates (#425)
It was broken in Next.js 14.0.3 due to shallow updates not calling the patched history methods, and fixed in Next.js 14.0.4. However, since turning on the `windowHistorySupport` flag causes `useSearchParams` to be reactive to shallow URL query changes, there's no longer need for this method. Marking it as deprecated now, and will be dropped along with other deprecations in v2.0.0 once WHS lands in GA. Closes #422.
- Loading branch information
Showing
2 changed files
with
8 additions
and
17 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
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 |
---|---|---|
|
@@ -27,6 +27,14 @@ declare global { | |
} | ||
} | ||
|
||
/** | ||
* @deprecated Since Next.js introduced shallow routing in 14.0.3, this | ||
* method is no longer needed as you can use `useSearchParams`, which will | ||
* react to changes in the URL when the `windowHistorySupport` experimental flag | ||
* is set. | ||
* This method will be removed in `[email protected]`, when Next.js | ||
* decides to land the `windowHistorySupport` flag in GA. | ||
*/ | ||
export function subscribeToQueryUpdates( | ||
callback: (args: QueryUpdateNotificationArgs) => void | ||
) { | ||
|