Skip to content

history.state is getting clobbered by Router #7698

@fangeugene

Description

@fangeugene

Bug report

Describe the bug

Entries added to history.state are not preserved after navigating away and back to the page.

To Reproduce

  1. On any page, enter history.replaceState({ ...history.state, hello: 'world' }, location.href) in the console
  2. Click on a link that navigates away from the page
  3. Click "back" in the browser
  4. See that console.log(history.state) does not include {hello: 'world'}

Expected behavior

{hello: 'world'} to be a part of the state.

System information

  • OS: Ubuntu 18.04
  • Browser: Chrome, Firefox
  • Version of Next.js: 8.1.0

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