question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

navigate! appends query when using html5

See original GitHub issue

When using :html5? true, the query gets appended to the the URL in the browser when using navigate!. The following generates a url ending with ?show-fields=true?show-fields=false?show-fields=true?show-fields=false?show-fields=true after toggling a few times. With :html5? false it works as expected.

(defn navigate! [view params query] 
  (debugf "Navigating to: %s" {:view view :params params :query query})
  (bide/navigate! router view params query))

(defn toggle-fields-visible! [{:keys [name params query]}]
  (navigate! name params (update query :show-fields #(if (= "true" %) "false" "true"))))

The output is:

DEBUG [xxx.core:31] - Navigating to: {:view :xxx/query-table, :params {:table-name "log"}, :query {:show-fields "false"}}

Nice library!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kennyjwillicommented, Oct 30, 2019

If you have :html5? true set, you will get the problem. Setting :html5 (without the ?) does not use the html5 history. This is definitely a bug.

0reactions
benzapcommented, Mar 23, 2020

I’m still seeing this issue. I’ll look into creating a fix PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

React router appending query to URL - Stack Overflow
2) How can I stop it from appending the query to the url? Here is the code I have so far: var React...
Read more >
Navigate to a URL with Query Strings (Search Params) in ...
Navigate to a URL with Query Strings (Search Params) in React Router. Todd Motto ... because the whole string is appended to the...
Read more >
5.4 Session history and navigation — HTML5 - W3C
Append a new entry at the end of the History object representing the new resource and its Document object and related state. Its...
Read more >
Navigation in React App using React Router (v6)
We can pass the absolute path where the user needs to be navigated or call navigate(-1) to go back a page. GIF Navigating...
Read more >
Using React with the History API - Pluralsight
Routing in React makes extensive use of the HTML5 History API. In this guide, you'll be introduced to the History API and build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found