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

[gatsby-link] to should be of type string or location object #3309

Closed
nsimonson opened this issue Dec 22, 2017 · 1 comment
Closed

[gatsby-link] to should be of type string or location object #3309

nsimonson opened this issue Dec 22, 2017 · 1 comment

Comments

@nsimonson
Copy link
Contributor

nsimonson commented Dec 22, 2017

Description

gatsby-link does not accept a location object as specified in react-router as a valid prop.

Environment

Gatsby version: 1.9.119
Node.js version: 8.9.1
Operating System: macOS 10.13.2

Actual result

<Link to={{ pathname: '/my-page', search: '?sort=name', }} />

Passing an object to the to prop of Link results in a url of "/[object Object]"

Expected behavior

Url should be "/my-page?sort=name"

...

Current work around is to use Link directly from react-router-dom

@KyleAMathews
Copy link
Contributor

Yeah, we don't currently support the location version — for no particular reason :-) Happy to take a PR to gatsby-link adding support!

This was referenced Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants