History: Where did useQueries Go

Created on 13 Sep 2016  Â·  4Comments  Â·  Source: ReactTraining/history

For some reason, modules that my project is depending on, all of a sudden disappeared without a trace. This is very bad and should not happen, especially without documenting the change. The specific module I am looking for is useQueries.

Most helpful comment

Hi @jamrizzi :) With the major version bump we completely removed query parsing and handling from core. The location objects emitted by history are now a strict subset of the DOM's Location interface which does not include a query property. This change was documented in the change notes leading up to version 4.

You can still get the query string pretty easily using a 3rd-party query parsing library like query-string.

import { parse } from 'query-string'

history.listen(location => {
  const query = parse(location.search)
})

All 4 comments

Sounds like the version in your package.json is very bad.
On Mon, Sep 12, 2016 at 9:28 PM Jam Risser [email protected] wrote:

For some reason, modules that my project is depending on, all of a sudden
disappeared without a trace. This is very bad and should not happen,
especially without documenting the change.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mjackson/history/issues/364, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGHaDppt-com99GvKCcJ6Y4nWe8hC-8ks5qpiaAgaJpZM4J7SAQ
.

Let me be a little clearer. What happened to useQueries in version 4. Yes I
know if I use an older version things work fine. I like my stuff being
updated, and this is preventing it.

On Tue, Sep 13, 2016, 02:57 Ryan Florence [email protected] wrote:

Sounds like the version in your package.json is very bad.
On Mon, Sep 12, 2016 at 9:28 PM Jam Risser [email protected]
wrote:

For some reason, modules that my project is depending on, all of a sudden
disappeared without a trace. This is very bad and should not happen,
especially without documenting the change.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mjackson/history/issues/364, or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AAGHaDppt-com99GvKCcJ6Y4nWe8hC-8ks5qpiaAgaJpZM4J7SAQ

.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/mjackson/history/issues/364#issuecomment-246604470,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF8fthqPKjHpCq1Q9wfsj0NnK3kAjPwwks5qpldYgaJpZM4J7SAQ
.

  • Jam Risser

Hi @jamrizzi :) With the major version bump we completely removed query parsing and handling from core. The location objects emitted by history are now a strict subset of the DOM's Location interface which does not include a query property. This change was documented in the change notes leading up to version 4.

You can still get the query string pretty easily using a 3rd-party query parsing library like query-string.

import { parse } from 'query-string'

history.listen(location => {
  const query = parse(location.search)
})

I have wrote a library history-query-enhancer which enhance history with a high-order function.
Hope it helps.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kirill-konshin picture kirill-konshin  Â·  7Comments

andi5 picture andi5  Â·  6Comments

AndreasHogstrom picture AndreasHogstrom  Â·  4Comments

wssgcg1213 picture wssgcg1213  Â·  6Comments

saadbinsaeed picture saadbinsaeed  Â·  8Comments