Skip to content

Page props.location.search not updated when query string is changed #6227

@ifvictr

Description

@ifvictr

Description

The search value of a page's location prop is not updated when the URL query parameter is changed.

Steps to reproduce

  1. Log props before change.
  2. Change query string.
  3. Log props after change.

Expected result

What should happen?
search should be updated with the value of the new query string.

Actual result

What happened.
search remains the value it was when the component was mounted.

Environment

 System:
    OS: Linux 4.9 Ubuntu 14.04.5 LTS, Trusty Tahr
    CPU: x64 Intel(R) Xeon(R) CPU @ 2.30GHz
    Shell: 4.3.11 - /bin/bash
  Binaries:
    Node: 8.9.4 - ~/.nvm/versions/node/v8.9.4/bin/node
    Yarn: 1.7.0 - ~/.nvm/versions/node/v8.9.4/bin/yarn
    npm: 6.1.0 - ~/.nvm/versions/node/v8.9.4/bin/npm
  npmPackages:
    gatsby: ^1.9.232 => 1.9.273 
    gatsby-link: ^1.6.39 => 1.6.45 
    gatsby-plugin-favicon: ^2.1.1 => 2.1.1 
    gatsby-plugin-react-helmet: ^2.0.7 => 2.0.11 
    gatsby-plugin-react-next: ^1.0.11 => 1.0.11 
    gatsby-plugin-resolve-src: ^1.0.0 => 1.1.3 
    gatsby-plugin-segment: ^1.0.2 => 1.0.2 
    gatsby-plugin-sitemap: ^1.2.25 => 1.2.25 
    gatsby-plugin-styled-components: ^2.0.9 => 2.0.11 
  npmGlobalPackages:
    gatsby-cli: 1.1.58

Metadata

Metadata

Assignees

No one assigned

    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