Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

QueryString handling #1

Closed
firedev opened this issue Mar 22, 2019 · 3 comments
Closed

QueryString handling #1

firedev opened this issue Mar 22, 2019 · 3 comments
Labels
enhancement New feature or request under development I am working on it! :D
Projects

Comments

@firedev
Copy link

firedev commented Mar 22, 2019

Nice and clean. Do you plan to have a way of handing query string?

@Paratron Paratron added the enhancement New feature or request label Mar 22, 2019
@Paratron
Copy link
Owner

Paratron commented Mar 22, 2019

This is an interesting suggestion! I would not use it for the routing itself tough, but make the query/GET params available in the result function.

For example, if you have this URL: /section/plushies?order=asc, I would have the route processed like this:

const routes = {
    '/section/:sectionName': ({sectionName}, {order}) => <RenderSection name={sectionName} sortOrder={order} />
};

Having a second argument passed to the result function would not break the existing API.

@Paratron Paratron added the under development I am working on it! :D label Mar 26, 2019
@danielkcz danielkcz mentioned this issue Mar 27, 2019
@Paratron Paratron added this to Done (to be released) in Version 2.0 Mar 28, 2019
@arvinsingla
Copy link

arvinsingla commented Mar 30, 2019

This is the exact question I was going to ask and the exact answer I was hoping to hear. Hope you’ll consider adding this. This project looks awesome!

Edit: just realized you tagged this as “Done(to be released)” yay!!

@Paratron
Copy link
Owner

Paratron commented Apr 1, 2019

Released with 1.1.0.

Can be used with the useQueryParams() hook, which returns [queryParams, setQueryParams]. Its completely object based and automatically serialized/deserialized. Docs to follow.

@Paratron Paratron closed this as completed Apr 1, 2019
sscaff1 referenced this issue in sscaff1/hookrouter Sep 17, 2021
* fix the `wth` exception

* add comment for the wth error

* fix indentation
sscaff1 referenced this issue in sscaff1/hookrouter Sep 17, 2021
Merge in UI/hookrouter from patched to master

* commit '902a1bd11ef3f1798f130fbfa7425784ff53cb29':
  add history state
  1.5.0
  1.4.0
  WTH exception handling (#1)
  fix package lock
  bump version number
  update package json
  fix some vulnerabilities
  update package name and add README entry
  Revert "add dist files so we can directly install this package from the sources"
  fix build
  add build script
  add dist files so we can directly install this package from the sources
  add to gitignore
  fix parantheses
  Remove extra closing parentheses
  Update Link.js
  Update Link.js
  Support React 17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request under development I am working on it! :D
Projects
Version 2.0
  
Done (to be released)
Development

No branches or pull requests

3 participants