Skip to content

[BUG] Hard refresh on any route reverts the app to the root ("/") path #4

@DaleStack

Description

@DaleStack

📝 Describe the Bug

When a user navigates to a specific route via the SPA router and performs a hard browser refresh (F5), the application successfully reloads but drops the user back at the root route (/), losing their current page context.


Minimal Reproducible Example

To reproduce this, make the following components:

  1. Make a HomePage component returning a simple header.
  2. Make a CounterPage component returning a simple header.
  3. Make an App component that wraps them both in a Router:
def App(**props):
    return Router(
        routes={
            "/": HomePage,
            "/counter": CounterPage
        }

🔁 Steps to Reproduce

  1. Start the server and navigate to http://localhost:8000.

  2. Navigate to http://localhost:8000/counter (either by typing it or clicking a Link).

  3. The CounterPage will render.

  4. Perform a hard refresh (F5).

  5. You will be returned to "/" which will affect development when using hot reload


✅ Expected Behavior

The CounterPage shouold remain on the screen.


💻 Environment

  • OS: Windows 11
  • Python Version: [e.g. 3.13]
  • Pyponent Version: v0.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions