Loader synchronization failure in nested route hierarchies
0 reputation · 09 Jun 2022, 16:58 UTC
Data Bounding with URL Search Parameters
In React Router v6, pagination state is typically managed by extracting page indices and limits from the request.url within a route loader. This ensures that the dataset is bounded at the API level and the state remains shareable via the URL.
Nested Route Synchronization
When a parent route manages the primary search parameters for a dataset, child routes often depend on those same parameters to filter or refine the displayed data. While a full navigation event triggers all relevant loaders, there is uncertainty regarding the behavior of nested loaders when search parameters are updated in a way that does not trigger a full route transition.
This creates a potential synchronization gap where the parent route reflects the new pagination state, but nested loaders may not re-execute as expected.
- Does a change in search parameters exclusively at the parent level guarantee the re-execution of all descendant loaders?
- What is the documented mechanism for forcing a nested loader to synchronize with parent search parameter changes without triggering a full page reload?