-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
📝 Describe the Bug
When navigating between two entirely different routed components that both use the use_state hook, the internal state of the first component is incorrectly carried over and injected into the second component.
Minimal Reproducible Example
To reproduce this, make two distinct components that use state, and a navigation bar to swap them:
- Make a
CounterPagecomponent usinguse_state(0)with an increment button. - Make a
TypePagecomponent usinguse_state("")with a text input. - Make a
NavBarwith<Link>components pointing to/counterand/type. - Wrap them in a
Routerinside the mainAppcomponent.
🔁 Steps to Reproduce
Steps to reproduce the behavior:
- Load the app and click the link to
/counter. - Click the increment button until the state reaches
2. - Click the link to
/type. - Bug 1: The text input is pre-filled with the integer
2. - Type the string "hello" into the input field.
- Click the link to go back to
/counter. - Bug 2: The counter display now shows the string "hello".
✅ Expected Behavior
Components should have their own state
💻 Environment
- OS: Windows
- Python Version: 3.13
- Pyponent Version: v0.1.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working