-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs]: RR7 lazyRouteDiscover (Fog of War) opt-out #12656
Comments
Same here. Would love to see a way to opt out the feature or configure it. |
We need more control over Fog of War. I noticed the same issue, we have a search results page where each result is a different link. React Router fetches a manifest for all the links, but it's just a single route with parameters. It would be great to have some way to exclude links from discovery and just use whatever is already loaded. The initial manifest only contains the matched routes. Therefore a manifest is always fetched on page load. We should have an (optional) option to eagerly load those as well. |
I digged a bit deeper in source code and it seems there is only 1 solution - use For an example // Main navigation
<Link to={'/'}>Home</Link>
<Link to={'/products'}>Products</Link>
<Link to={'/login'}>Login</Link>
<Link to={'/register'}>Register</Link>
...
// Filters
<Link to={'/products?color[]=blue'} discover={'none'}>Blue</Link>
<Link to={'/products?color[]=red'} discover={'none'}>Red</Link>
<Link to={'/products?color[]=red&color[]=blue'} discover={'none'}>Blue</Link> // in case red is active already
<Link to={'/products?color[]=blue&color[]=red'} discover={'none'}>Red</Link> // in case blue is active already
// Pagination
<Link to={'/products?page=2'} discover={'none'}>2</Link>
// Products
{items.map((item, key) => (
<Link to={`/products/${item.slug}`} discover={'none'}>
<ProductCard item={item} discover={key === 0 ? 'render' : 'none'} />
</Link>
))} However, it gets really messy and hard to maintain such a mayhem project in the future. Let's hope to hear authors thoughts soon. |
Missing information how to disable lazy route discover (also known as Fog of War) feature.
In my case, it causes unnecessary overhead on application which renders thousands of links (filters and products) but there are only 7 RR routes in total. Would love to disable the feature.
The text was updated successfully, but these errors were encountered: