Search params in loader (unclear part of the documentation)
Hi, I'm reading the documentation related to the rationale for not having search params directly available in the loader and I'm not sure I understand the rationale
: https://tanstack.com/router/v1/docs/framework/react/guide/data-loading#using-search-params-in-loaders
Assuming the router scopes each request based on pathname + search params, in what case would using search params (vs different route segments) cause the issues described in the section?
-----
For example this section:
It's unclear to me why I would end up storing page's 2 data in page 1s? Since route /posts?page=1 and /posts?page=2 are different and therefore I'd expect them to be stored differently?
Assuming the router scopes each request based on pathname + search params, in what case would using search params (vs different route segments) cause the issues described in the section?
-----
For example this section:
For example, you might ask your /posts route to preload page 2's results, but without the distinction of pages in your route configuration, you will end up fetching, storing and displaying page 2's data on your /posts or ?page=1 screen instead of it preloading in the background!
It's unclear to me why I would end up storing page's 2 data in page 1s? Since route /posts?page=1 and /posts?page=2 are different and therefore I'd expect them to be stored differently?