Skip to content
This repository was archived by the owner on Dec 15, 2018. It is now read-only.
This repository was archived by the owner on Dec 15, 2018. It is now read-only.

Query parameters not in router state when navigating with back button. #127

@ngbrown

Description

@ngbrown

I am running the most recent version, v12.1.1 and items that are parameters (?q=test) show up in state.router.query when navigating directly by url, or when pushing state. However, when the back button is used after navigating to another route in the app, the state.router.query doesn't exist on state.router.

This is how I'm connecting to the parameters:

const mapStateToProps = (state, ownProps) => {
  return {
    query: state.router.query.q
  }
};

export default connect(mapStateToProps)(Search)

Guarding for the existence of state.router.query doesn't help because it never shows up when using the back button.

This is what the Redux debugger shows when navigating forward to a link with a parameter:

screenshot - 2016-12-05 2_12_08 am

This is what it shows when navigating back to the same page:

screenshot - 2016-12-05 2_12_45 am

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