Skip to content

0.3.11

Latest

Choose a tag to compare

@SukkaW SukkaW released this 05 Sep 12:25
· 1 commit to master since this release

Core Changes

  • Add an optional ReadonlySearchParamsProvider for useReadonlySearchParams.
    • Previously, useReadonlySearchParams only subscribed to the browser's popstate event, which keeps it up-to-date during history traversal (e.g., when the user navigates back or forward). Calling window.history.pushState or window.history.replaceState does not emit popstate and therefore does not update the hook by default.
    • Now, if you wrap your app with ReadonlySearchParamsProvider, the provider will patch both History API methods and allow useReadonlySearchParams to also update after window.history.pushState and window.history.replaceState.
    • Existing usage of useReadonlySearchParams without the provider will continue to work as before.