Skip to content

Router query chops away chars #10185

@vongohren

Description

@vongohren

Bug report

Describe the bug

When passing some variables as query parameter, some chars get removed in router.query values.
Feks phonenumbers: +47111111111, then when getting the query.contact, the pluss is gone.
Is there a way for me to tap into this to get the pluss added?

I tried encoding before sending in, but + is not misunderstood.
I see the right value, with the +, in the asPath variable

To Reproduce

const Index = () => {
  const router = useRouter()
  const { contact } = router.query
  const hasThePlussSign = router.asPath;
  return (
    <div>
      {contact}
    </div>

  )
}

Expected behavior

Get the + sign included in the query value

System information

  • OS: macOS
  • Browser (if applies): chrome
  • Version of Next.js: 9.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions