navigate! appends query when using html5
See original GitHub issueWhen 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:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.I’m still seeing this issue. I’ll look into creating a fix PR