Skip to content
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

fix: prevent returning the previous route data on route transition #646

Merged
merged 2 commits into from
Mar 15, 2025

Conversation

Valerioageno
Copy link
Member

@Valerioageno Valerioageno commented Mar 14, 2025

Checklist

Related issue

Fixes #626

Overview

@Valerioageno Valerioageno self-assigned this Mar 14, 2025
@github-actions github-actions bot added the typescript Requires typescript knowledge label Mar 14, 2025
@Valerioageno Valerioageno force-pushed the return-null-on-loading branch from 63d8664 to 868f3de Compare March 14, 2025 17:22
@Valerioageno Valerioageno requested a review from jacobhq March 14, 2025 17:23
@Valerioageno Valerioageno marked this pull request as ready for review March 14, 2025 17:26
jacobhq

This comment was marked as resolved.

@marcalexiei

This comment was marked as resolved.

</div>
)) as RouteComponent
RootComponent.preload = vi.fn()
RootComponent.displayName = routeType
return RootComponent
}

function createLeafRouteComponent(routeType: string): RouteComponent {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From @jacobhq review comment #646 (review)

Looks good, although I don't understand why we need the createLeafRouteComponent function, would you mind explaining?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense having them separate, since passing data creates a weird HTML output that is weird dealing with.

@marcalexiei marcalexiei merged commit 1c45b29 into main Mar 15, 2025
29 checks passed
@marcalexiei marcalexiei deleted the return-null-on-loading branch March 15, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Requires typescript knowledge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Routes will initially render with props from previous route
3 participants