-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Description
Summary
When loading a List page, react-admin reads filter and list params from the store (localParams), but does not automatically sync missing params back to the URL if they aren't present. This can lead to a desynchronization between persisted state and browser address, causing navigation inconsistencies and confusion.
Expected Behavior
- If state parameters (filters, page, sort, etc.) are present in localParams/store but not in the URL, the application should update the URL with these parameters to ensure consistency.
Actual Behavior
- The current behavior merges params from the URL and store, but does not update the browser location when the URL is missing parameters. This means users can land on a list in a state that isn't reflected in the URL, making it hard to share or bookmark their current state, and breaking expected navigation (such as back/forward).
Steps to Reproduce
- Open a List with filters or custom params persisted in the store.
- Remove params from the URL (e.g. by direct navigation or clearing query string).
- Observe that the page loads with state from store, but the URL does not reflect the current filter/page/sort.
- Bookmarking or refreshing can result in confusion.
Discussion Topics / Proposal
- Should there be an option to always sync missing params from localParams/store into the URL?
- What are the best practices for keeping store and URL state consistent for navigation, sharing, and bookmarking?
Environment
- React-admin version: Current (v4/v5)
- React version: 17/18
- Browser: All
This thread is meant to gather community feedback and solutions, as well as potential workarounds. Any insight from the maintainers on the reasoning and recommended patterns is highly appreciated!
Metadata
Metadata
Assignees
Labels
No labels