Avoid '/?' with query params?
jashworth opened this issue · comments
jashworth commented
format(query(t.strict({ foo: t.string })).formatter, { foo: 'foo' }); // /?foo=foo
Is there a convenient way to avoid the leading '/?'
(want to build value for react-router <Link to={{ search: ... }}>)
Stefano Magrassi commented
@jashworth nope: the leading /
is always added in order to have a compliant path and the ?
is the URL's spec separator for query parameters
I think that the best way to retrieve the search
part is to convert the full path into a URL
object, get the value from it and then remove the leading ?