Skip to content

Props from Navigation disappear at page refresh/reload #4332

@BastianW13

Description

@BastianW13
  • Framework7 version: ^8.3.4
  • React.js version: ^18.3.1
  • Platform and Target: Desktop App
  • Live Link or CodeSandbox: Can not be replicated in Sandbox due to different behaviour when reloading the page

Describe the bug

When navigating to a route and passing props with the options
f7.views.main.router.navigate("/somePage/", {props: {id: 123}})
the props object correctly contains id. But when reloading the page (via Browser) it disappears.

Additional Information:

  • I am using browserHistory as defined in the View Component. Otherwise the reload wouldn't even work as intended.
  • f7router and f7route stay in the props object even after reloading

To Reproduce

Just build a simple app, try navigation with props and then reload the page. Control the contained props with React DevTools, or just log them to the console with a useEffect.

Expected behavior

The set property from navigation should stay when reloading the page.

Actual Behavior

It does not persist.

Additional context

My guess would be that this behaviour might be somewhat intended, since navigating directly to the page (via URL) does not provide any properties and distinguishing between that and a page reload could be difficult. But i think this should still work.
I will probably work around this by storing the passed property in a global store that provides it's own persistence, but i still f7 should be able to handle this.

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