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

NextJS doesn't support parsing nested objects in query parameters #2530

Closed
1 task done
pencilcheck opened this issue Jul 11, 2017 · 5 comments
Closed
1 task done

NextJS doesn't support parsing nested objects in query parameters #2530

pencilcheck opened this issue Jul 11, 2017 · 5 comments
Assignees

Comments

@pencilcheck
Copy link
Contributor

pencilcheck commented Jul 11, 2017

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Expected at least nested objects be supported and parsed correctly from query

Current Behavior

It takes the whole thing as a key, instead of creating an nested object
Doesn't matter the format, none of them works
/?nested[key]=value
or
/?nested.key=value

Steps to Reproduce (for bugs)

  1. Open the page with the pattern above
  2. Print the this.props.url.query in top level page component
  3. Does not work

Context

I can't pass nested object over arbitrarily if I am not using <Link /> component, actually I'm not sure if <Link /> would work with nested object since it is using npm 'url' which does not supported nested object parsing...

Btw, I'm currently using https://github.com/ljharb/qs for parsing atm, I hope this saves you all time if you are looking for alternatives.

Your Environment

Tech Version
next 2.4.6
node 8.1.3
OS macOS Sierra
browser chrome
etc
@arunoda arunoda self-assigned this Jul 15, 2017
@arunoda
Copy link
Contributor

arunoda commented Jul 15, 2017

Yes. This is something we should work on.
Will do this after 3.0.

Feel free to send us a PR.

@pencilcheck
Copy link
Contributor Author

I think @chrismatheson has a PR, what do you all think?

@timneutkens
Copy link
Member

See #2605 (comment)

@chrismatheson
Copy link

im a little confused, @arunoda 's comments seem to imply that the feature is something that is desirable, but the issue has been closed?

Would an implementation that uses something more lightweight than the qs lib be and adequate solution?

@arunoda
Copy link
Contributor

arunoda commented Dec 10, 2017

@chrismatheson as @timneutkens mentioned size of the qs is the problem here.
We are open to use a smaller well maintained alternative (if exists)

@lock lock bot locked as resolved and limited conversation to collaborators Dec 10, 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

4 participants