Skip to content

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

@pencilcheck

Description

@pencilcheck
  • 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions