You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Search params can appear more than once in the query string, like so: ?foo=bar&foo=baz
This reflects in URLSearchParams under a different API:
getAll to obtain an array of values: ['bar', 'baz']
get would only return the first entry (specification): 'bar'
append does what it says, and adds a new entry when updating (eg: .append('foo', 'qux') will give ?foo=bar&foo=baz&foo=qux)
set overrides any existing value (eg: .set('foo', 'qux') will give ?foo=qux)
In order to support this, some refactoring of the parsers, hook logic, and type definitions needs to be done, as it only ever worked with one-dimensional values.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Search params can appear more than once in the query string, like so:
?foo=bar&foo=baz
This reflects in URLSearchParams under a different API:
getAll
to obtain an array of values:['bar', 'baz']
get
would only return the first entry (specification):'bar'
append
does what it says, and adds a new entry when updating (eg:.append('foo', 'qux')
will give?foo=bar&foo=baz&foo=qux
)set
overrides any existing value (eg:.set('foo', 'qux')
will give?foo=qux
)In order to support this, some refactoring of the parsers, hook logic, and type definitions needs to be done, as it only ever worked with one-dimensional values.
Related discussions
Originally posted by @ianldgs in #481 (comment)
Beta Was this translation helpful? Give feedback.
All reactions