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

Adding query string doesn't trigger update #3431

Closed
OKNoah opened this issue Jan 7, 2018 · 3 comments
Closed

Adding query string doesn't trigger update #3431

OKNoah opened this issue Jan 7, 2018 · 3 comments

Comments

@OKNoah
Copy link

OKNoah commented Jan 7, 2018

Description

When I add a query string to the URL, the app does not update.

<Link to="/?hello" />
// or
this.props.history.push('/') // removing a querystring

Environment

Gatsby version: 1.1.28
Node.js version: 8.9.1
Operating System: macOS

Actual result

shouldComponentUpdate (nextProps) {
 // this does not execute at all when query string changes
}

Expected behavior

The component should update

Steps to reproduce

1. Use Link or history to go to /?someString

2. Observe that component does not update.

@calcsam
Copy link
Contributor

calcsam commented Jan 14, 2018

Should be fixed when #3516 is merged

@OKNoah
Copy link
Author

OKNoah commented Jan 14, 2018

As a workaround I used this.forceUpdate and the global location. But that meant if I triggered an update in a child component I had to pass forceUpdate down through props.

@calcsam Thanks!

@KyleAMathews
Copy link
Contributor

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

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

3 participants