Open aalises opened 5 years ago
Made a pull request adding support for qs: #9
fair point, but why specifically querystring format?
ie: I have a component that listens to /user-list/:searchParams, so it receives params like this /user-list/name,jose
otherwise /user-list/null
@k1r0s yes! We already use the path parameter parsing, they're amazing. The support for query strings is just adding more flexibility to the parsing by adding minimal change.
In our case, the backend links sometimes return URLs with query string parameters, so in-path parameters are also used within the application but we also need a way to obtain these query string parameters.
Currently
preact-routlet
does not support querystrings on the URL (e.g/testpath?foo=bar&zzz=baz
). When adding them to a url, the router does not recognize the path.It would be nice to implement recognizing querystrings on the routlet by adding another prop,
search
, which includes the querystring in the formatthis.props.search = "?param1=value1¶m2=value2"