fix(deps): update dependency use-query-params to v2#915
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
fix(deps): update dependency use-query-params to v2#915renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
|
Projektor reports
|
7b4c265 to
0c0515a
Compare
0c0515a to
5e4d012
Compare
5e4d012 to
47a28ec
Compare
47a28ec to
a55a681
Compare
a55a681 to
c8c2615
Compare
c8c2615 to
a2cf6d3
Compare
a2cf6d3 to
101151e
Compare
101151e to
f2332c9
Compare
f2332c9 to
40138c5
Compare
40138c5 to
df0f874
Compare
df0f874 to
58d6a0e
Compare
b4f7b01 to
d1cd042
Compare
602b4bb to
eda45c3
Compare
eda45c3 to
2eb670e
Compare
2eb670e to
db7d294
Compare
db7d294 to
0983bf9
Compare
d3bdcba to
a4fc365
Compare
a4fc365 to
2b9ba20
Compare
67daf8d to
9e36d8f
Compare
9e36d8f to
19b6e65
Compare
19b6e65 to
73cd8ac
Compare
73cd8ac to
d8c2fbe
Compare
02da360 to
8abf53a
Compare
8abf53a to
de82a2e
Compare
d5e0b6b to
3de7554
Compare
3de7554 to
85f9d2f
Compare
85f9d2f to
a4ba78e
Compare
a4ba78e to
7d87ed0
Compare
7d87ed0 to
ed6a241
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.2.3→2.2.2Release Notes
pbeshai/use-query-params (use-query-params)
v2.2.2: use-query-params v2.2.2, serialize-query-params v2.0.3Compare Source
What's Changed
New Contributors
Full Changelog: https://github.com/pbeshai/use-query-params/compare/use-query-params@2.2.1...use-query-params@2.2.2
v2.2.1: v2.2.1Compare Source
use-query-params v2.2.1 (March 24, 2023)
v2.2.0: v2.2.0Compare Source
v2.1.2Compare Source
v2.1.1: v2.1.1Compare Source
v2.1.0: v2.1.0Compare Source
use-query-params v2.1.0 (August 31, 2022)
skipUpdateWhenNoChangedefaults to true (set to false for previous behavior)v2.0.1: v2.0.1Compare Source
use-query-params v2.0.1 (August 31, 2022)
v2.0.0: v2.0.0Compare Source
use-query-params v2.0.0
Breaking
null. You can continue using query-string by specifying thesearchStringToObjectandobjectToSearchStringoptions as parse and stringify respectively.New Features
Deep imports for React-Router 5 and 6 adapters
Supports registering params in the QueryParamProvider to have them available to any downstream hooks.
Additional function signatures have been added, but greater care must be taken to get proper types out of the response.
useQueryParam(’myparam’)← param type is inherited from the params registered in the QueryParamProvideruseQueryParam(’myparam’, StringParam, options)useQueryParams()← gets all params from the QueryParamProvideruseQueryParams([’myparam1’, ‘myparam2’])← gets just myparam1 and myparam2 from those registered in the QueryParamProvider.useQueryParams({ myparam: StringParam }, options)useQueryParams({ myparam: ‘inherit’ }, options)←inherit myparam param name from QueryParamProviderNew
optionsprop to QueryParamProvider and argument to useQueryParam(s)enableBatchingoption (i.e., multiple consecutive calls to setQueryParams in a row only result in a single update to the URL). This seems to work but would require updating the way all the tests are written to verify for sure, so marking as experimental for now.removeDefaultsFromUrl(default: false). This happens on updates only, not on initial load. Requires the use of thedefaultattribute on a parameter to function (note serialize-query-params v2 withDefault now populates this).includeKnownParams- in addition to those specified, also include all preconfigured parameters from the QueryParamProviderincludeAllParams(default: false) - in addition to those specified, include all other parameters found in the current URLupdateType(default “pushIn”) - the default update type when set is called.searchStringToObject, objectToSearchString(default uses URLSearchParams) - equivalent ofparseandstringifyfrom query-string.Parameters now can include
urlNameto automatically convert to a different name in the URL (e.g. { encode, decode, urlName })Caches decoded values across multiple hook calls from different components
Fixes
Stops reading from refs in render to prepare for future versions of React where this is not allowed.
Simplifies the way locations are updated by only passing in the search string as the new location.
v2.0.0-rc.1 Fix CJS imports of adapters (#224)
v2.0.0-rc.1 Be more defensive about reading updateType
Migrating from v1
There are two things you need to adjust to update from v1:
searchStringToObjectandobjectToSearchString.Here's an example of the changes to complete both for React Router 5:
import React from 'react'; import ReactDOM from 'react-dom'; import { QueryParamProvider } from 'use-query-params'; + import { ReactRouter5Adapter } from 'use-query-params/adapters/react-router-5'; + import { parse, stringify } from 'query-string'; - import { BrowserRouter as Router, Route } from 'react-router-dom'; + import { BrowserRouter as Router } from 'react-router-dom'; import App from './App'; ReactDOM.render( <Router> - <QueryParamProvider ReactRouterRoute={Route}> + <QueryParamProvider + adapter={ReactRouter5Adapter} + options={{ + searchStringToObject: parse, + objectToSearchString: stringify, + }} + > <App /> </QueryParamProvider> </Router>, document.getElementById('root') );If you're using react-router-6, you'd import that adapter instead:
Note the
optionsabove are optional, but will retain the behavior you're used to from v1, which used query-string internally. If you want to switch to using URLSearchParams and not use query-string, you would do:import React from 'react'; import ReactDOM from 'react-dom'; import { QueryParamProvider } from 'use-query-params'; + import { ReactRouter5Adapter } from 'use-query-params/adapters/react-router-5'; - import { BrowserRouter as Router, Route } from 'react-router-dom'; + import { BrowserRouter as Router } from 'react-router-dom'; import App from './App'; ReactDOM.render( <Router> - <QueryParamProvider ReactRouterRoute={Route}> + <QueryParamProvider adapter={ReactRouter5Adapter}> <App /> </QueryParamProvider> </Router>, document.getElementById('root') );Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.