Re Renders Component Page Several Times #520
livevsonline
started this conversation in
General
Replies: 3 comments 4 replies
-
Upgrade your version first. Then I can take a look.
Tanner Linsley
…On Feb 8, 2023 at 3:44 AM -0700, Webwizard ***@***.***>, wrote:
Hi
I am setting up a very simple router like this:
const testRoute= new Route({
id: 'testRoute',
getParentRoute: () => rootRoute,
path: '/app/test/route',
component: lazy(() => import("@/pages/test/testPage")),
});
My App.tsx looks like this:
import './App.css';
import {router} from "@/Routes";
import {RouterProvider} from ***@***.***/react-router";
function App() {
return (
<div className="App">
<RouterProvider router={router}/>
</div>
)
}
export default App
In my testPage.tsx this is all i do:
function TestPage() {
console.log('How Many Times Does Test Page Render');
return <p>Hello Test Page</p>;
}
export default TestPage;
However the TestPage is rendered several times as demonstrated below:
Why is this happening? Is there a bug with the state flow of the router?
I'm on version: ^0.0.1-beta.61
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
-
I'm also seeing double renders and am wondering if this is expected. I was able to reproduce on the Quickstart Example on the website. I added some The example is using version 1.38.1. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I am setting up a very simple router like this:
My App.tsx looks like this:
In my testPage.tsx this is all i do:
However the TestPage is rendered several times as demonstrated below:

Why is this happening? Is there a bug with the state flow of the router or is this normal/expected :)?
I'm on version: ^0.0.1-beta.61
Beta Was this translation helpful? Give feedback.
All reactions