SolidJS and TanStack Router Excessive Rendering Issue
When integrating SolidJS with TanStack Router, there are unexpected rendering behaviors affecting performance. Specifically, the home page renders multiple times on initial load, and enabling
- The home page (
- Observed via
2. Unlimited Renders with Preload Intent:
- When
- This results in repeated
1. Create a New Project:
2. Modify Root Route (
defaultPreload: 'intent' causes continuous re-renders when hovering over links.Issues Identified
1. Multiple Renders on Home Page Load:- The home page (
/) renders at least four times upon initial navigation.- Observed via
console.log("index page render") in the Index component.2. Unlimited Renders with Preload Intent:
- When
defaultPreload: 'intent' is enabled in the router configuration, hovering over a link (e.g., "About") triggers continuous re-renders of the linked page's component.- This results in repeated
console.log("about page render") outputs as long as the mouse hovers over the link.Reproduction Steps
To reproduce the issues, follow these steps:1. Create a New Project:
2. Modify Root Route (
src/routes/__root.tsx):