Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: support URL objects #1341

Closed
rauchg opened this issue Mar 3, 2017 · 5 comments
Closed

Idea: support URL objects #1341

rauchg opened this issue Mar 3, 2017 · 5 comments

Comments

@rauchg
Copy link
Member

rauchg commented Mar 3, 2017

Everywhere we support string href, we can support a pathname + object/string query object:

<Link href={ pathname: '/aaa', query: { a: 'b' } }>
Router.push({ pathname: '/woot', query: { test: 2 } })

Would make many lives easier. AMA

@timneutkens
Copy link
Member

I created a wrapper to do this, let me see when I get back to my laptop :)

@timneutkens
Copy link
Member

#1118 (comment)

@rauchg
Copy link
Member Author

rauchg commented Mar 3, 2017

Yep I thought about a wrapper, but was bringing up the discussion of supporting it directly. Seems awfully common, and also has somewhat of a "symmetry" with app.render receiving a query object.

@timneutkens
Copy link
Member

Yep, and with how other routing packages do it, like react-router. Just wanted to drop it in here as reference 👍 I'm not opposed to this. I've seen many examples of people wrapping <Link> to do this exact thing, especially when they had a lot of query params.

@arunoda
Copy link
Contributor

arunoda commented Mar 12, 2017

Fixed with #1345

@arunoda arunoda closed this as completed Mar 12, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants